cs-au-dk / tajs Goto Github PK
View Code? Open in Web Editor NEWType Analyzer for JavaScript
Home Page: http://www.brics.dk/TAJS/
License: Apache License 2.0
Type Analyzer for JavaScript
Home Page: http://www.brics.dk/TAJS/
License: Apache License 2.0
When importing sources in Eclipse, I get two errors in CallDependencies, at lines 276 and 281:
The method transferReturn(dk.brics.tajs.flowgraph.AbstractNode, dk.brics.tajs.flowgraph.BasicBlock, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, dk.brics.tajs.solver.CallKind) in the type INodeTransfer<StateType,ContextType> is not applicable for the arguments (dk.brics.tajs.flowgraph.AbstractNode, dk.brics.tajs.flowgraph.BasicBlock, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, ContextType extends dk.brics.tajs.solver.IContext<ContextType>, dk.brics.tajs.solver.CallKind)
These errors don't show up in Idea or ant, so I guess the Eclipse integrated compiler is interpreting generics differently from OpenJDK.
Are you experiencing these too? Is Eclipse even used in TAJS development?
Thank you.
I'm running this example:
var src = {
alpha: 1,
beta: "testing",
gamma: new Boolean(true),
};
var dest = {};
for (var prop in src) {
dest[prop] = src[prop];
}
with show-variable-info flag and I get this:
It seems to be that src.prop is named as null. Building a pointer analysis wrapper on top of tajs and this null makes querying a pointer harder.
Known sources of unsoundness in the modeling of the core language and native library:
__proto__
These issues will be fixed "by need" if we find that they cause wrong analysis results on realistic programs.
Hi Team,
As part of my research, I was using TAJS and used its option -uneval. As mentioned in the paper Remedying the Eval that men do, it is to uneval the eval functions through different techniques. But when I run this on projects it does not give any such information if it was successful in unevalizing the eval function. Could you please help me in this? How can I get this information?
Thanks & Regards,
Ankur
When I run TAJS with -type-filtering flag I get the error, that I can't find the ts-spec-reader directory. What am I missing?
Analyzing the following file with java -jar dist/tajs-all.jar -nodejs test-node.js
raises an uncaught exception (reproduced below):
test-node.js
:
require('os');
The exception (compiled by changing debug
to on
in build.xml
):
Exception in thread "main" java.nio.file.ProviderMismatchException
at sun.nio.fs.UnixPath.toUnixPath(UnixPath.java:200)
at sun.nio.fs.UnixPath.relativize(UnixPath.java:410)
at sun.nio.fs.UnixPath.relativize(UnixPath.java:43)
at dk.brics.tajs.util.PathAndURLUtils.getRelativeTo(PathAndURLUtils.java:123)
at dk.brics.tajs.util.PathAndURLUtils.getRelativeToWorkingDirectory(PathAndURLUtils.java:116)
at dk.brics.tajs.flowgraph.SourceLocation.toUserFriendlyString(SourceLocation.java:255)
at dk.brics.tajs.flowgraph.SourceLocation.toString(SourceLocation.java:174)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.reportParseMessages(FlowGraphBuilder.java:179)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.makeAST(FlowGraphBuilder.java:165)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.transformFunctionBody(FlowGraphBuilder.java:616)
at dk.brics.tajs.js2flowgraph.FlowGraphMutator.addTopLevelFunction(FlowGraphMutator.java:181)
at dk.brics.tajs.js2flowgraph.FlowGraphMutator.extendFlowGraphWithTopLevelFunction(FlowGraphMutator.java:151)
at dk.brics.tajs.analysis.nativeobjects.FunctionFileLoader.loadFunction(FunctionFileLoader.java:89)
at dk.brics.tajs.analysis.nativeobjects.TAJSFunctionEvaluator.lambda$makeImplementations$29(TAJSFunctionEvaluator.java:521)
at dk.brics.tajs.analysis.nativeobjects.TAJSFunctionEvaluator$TAJSFunctionImplementation.transfer(TAJSFunctionEvaluator.java:795)
at dk.brics.tajs.analysis.nativeobjects.TAJSFunctionEvaluator.evaluate(TAJSFunctionEvaluator.java:129)
at dk.brics.tajs.analysis.HostAPIs.evaluate(HostAPIs.java:63)
at dk.brics.tajs.analysis.FunctionCalls.lambda$callFunction$0(FunctionCalls.java:347)
at dk.brics.tajs.solver.GenericSolver$SolverInterface.lambda$withState$0(GenericSolver.java:119)
at dk.brics.tajs.solver.GenericSolver$SolverInterface.withState(GenericSolver.java:109)
at dk.brics.tajs.solver.GenericSolver$SolverInterface.withState(GenericSolver.java:118)
at dk.brics.tajs.analysis.FunctionCalls.callFunction(FunctionCalls.java:338)
at dk.brics.tajs.analysis.js.NodeTransfer.visit(NodeTransfer.java:627)
at dk.brics.tajs.flowgraph.jsnodes.CallNode.visitBy(CallNode.java:255)
at dk.brics.tajs.analysis.Transfer.visit(Transfer.java:73)
at dk.brics.tajs.flowgraph.jsnodes.Node.visitBy(Node.java:42)
at dk.brics.tajs.analysis.Transfer.transfer(Transfer.java:62)
at dk.brics.tajs.solver.GenericSolver.solve(GenericSolver.java:372)
at dk.brics.tajs.Main.run(Main.java:296)
at dk.brics.tajs.Main.main(Main.java:93)
It's caused because there are some node.js modules modeled, but they are compiled into the jar, so they're not in the same filesystem as the file we analyze, and getting the relative path makes no sense.
Hi,
I want to install TAJS on my eclipse but it is blank and cannot be installed anymore.
Can someone help me out?
Thanks a lot
error detail info:
No support for default-case in non-last position
at dk.brics.tajs.js2flowgraph.FunctionBuilder.process(Unknown Source)
at dk.brics.tajs.js2flowgraph.FunctionBuilder.process(Unknown Source)
at dk.brics.tajs.js2flowgraph.asttraversals.DispatchingParseTreeAuxVisitor.process(Unknown Source)
why no support for default-case in non-last position ? ,What's wrong with putting it in the middle?
I've come across this in my own projects, maybe graphviz is just bad, but trying to view even the smallest files flowgraphs in .ps form e.g. dot -Tps out/flowgraphs/initial.dot -o out/initial.ps
just gets cut off in any viewer I try.
Any suggestions on how to view them better?
Thanks for making TAJS, it's a great project!
var http2 = require('http');
var fs = require('fs');
var cats = require('cat-ascii-faces');
var uuidv4 = require('uuid/v4');
var digit = 10
http2.createServer(function (req, res) {
var name = require('url').parse(req.url, true).query.name;
if (name === undefined) name = 'world';
if (name == 'burningbird') {
var file = 'phoenix5a.png';
fs.stat(file, function (err, stat) {
if (err) {
console.error(err);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end("Sorry, Burningbird isn't around right now \n");
} else {
var img = fs.readFileSync(file);
res.contentType = 'image/png';
res.contentLength = stat.size;
res.end(img, 'binary');
} });
} else {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello ' + name + '\n');
}
}).listen(8124);
cats();
uuidv4();
console.log('Server running at port 8124/');
require('url').parse(req.url, true);
java -jar dist/tajs-all.jar -flowgraph -nodejs -babel /Users/diffyao/Code/node_learn/npm_check/easy_app/index.js
used the tajs-all.jar file on Windows 7, java 8u60
Exception in thread "main" java.util.MissingResourceException: Can't find bundle
for base name rhino_ast.java.com.google.javascript.rhino.Messages, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at com.google.javascript.rhino.SimpleErrorReporter.getMessage(SimpleErro
rReporter.java:124)
at com.google.javascript.rhino.SimpleErrorReporter.getMessage0(SimpleErr
orReporter.java:109)
at com.google.javascript.jscomp.parsing.JsDocInfoParser$ErrorReporterPar
ser.addTypeWarning(JsDocInfoParser.java:84)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.reportTypeSyntax
Warning(JsDocInfoParser.java:2485)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.reportGenericTyp
eSyntaxWarning(JsDocInfoParser.java:2490)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseBasicTypeEx
pression(JsDocInfoParser.java:2023)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseTypeExpress
ion(JsDocInfoParser.java:1965)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseTopLevelTyp
eExpression(JsDocInfoParser.java:1885)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseTypeExpress
ionAnnotation(JsDocInfoParser.java:1794)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseAndRecordTy
peNode(JsDocInfoParser.java:1411)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseAndRecordTy
peNode(JsDocInfoParser.java:1347)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseAnnotation(
JsDocInfoParser.java:991)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseHelperLoop(
JsDocInfoParser.java:262)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parse(JsDocInfoP
arser.java:252)
at com.google.javascript.jscomp.parsing.NewIRFactory.createJsDocInfoPars
er(NewIRFactory.java:819)
at com.google.javascript.jscomp.parsing.NewIRFactory.handleJsDoc(NewIRFa
ctory.java:566)
at com.google.javascript.jscomp.parsing.NewIRFactory.handleJsDoc(NewIRFa
ctory.java:583)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:652)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processExpressionStatement(NewIRFactory.java:1042)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processExpressionStatement(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:209)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processBlock(NewIRFactory.java:978)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processBlock(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:191)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processFunction(NewIRFactory.java:1160)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processFunction(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:219)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processNewExpression(NewIRFactory.java:1372)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processNewExpression(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:235)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclaration(NewIRFactory.java:1802)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclaration(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:259)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transformNodeWithIn
lineJsDoc(NewIRFactory.java:688)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$1800(NewIRFa
ctory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclarationList(NewIRFactory.java:1792)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclarationList(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:257)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$3100(NewIRFa
ctory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableStatement(NewIRFactory.java:1757)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableStatement(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:255)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processBlock(NewIRFactory.java:978)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processBlock(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:191)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processFunction(NewIRFactory.java:1160)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processFunction(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:219)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processNewExpression(NewIRFactory.java:1372)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processNewExpression(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:235)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclaration(NewIRFactory.java:1802)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclaration(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:259)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transformNodeWithIn
lineJsDoc(NewIRFactory.java:688)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$1800(NewIRFa
ctory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclarationList(NewIRFactory.java:1792)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableDeclarationList(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:257)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$3100(NewIRFa
ctory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableStatement(NewIRFactory.java:1757)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processVariableStatement(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:255)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transform(NewIRFact
ory.java:653)
at com.google.javascript.jscomp.parsing.NewIRFactory.access$300(NewIRFac
tory.java:109)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processAstRoot(NewIRFactory.java:932)
at com.google.javascript.jscomp.parsing.NewIRFactory$TransformDispatcher
.processAstRoot(NewIRFactory.java:890)
at com.google.javascript.jscomp.parsing.NewTypeSafeDispatcher.process(Ne
wTypeSafeDispatcher.java:245)
at com.google.javascript.jscomp.parsing.NewIRFactory.justTransform(NewIR
Factory.java:887)
at com.google.javascript.jscomp.parsing.NewIRFactory.transformTree(NewIR
Factory.java:274)
at com.google.javascript.jscomp.parsing.ParserRunner.parseEs6(ParserRunn
er.java:196)
at com.google.javascript.jscomp.parsing.ParserRunner.parse(ParserRunner.
java:111)
at dk.brics.tajs.js2flowgraph.JavaScriptParser.parse(Unknown Source)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.makeAST(Unknown Source)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.transformCode(Unknown Sou
rce)
at dk.brics.tajs.js2flowgraph.FlowGraphBuilder.transformStandAloneCode(U
nknown Source)
at dk.brics.tajs.Main.init(Unknown Source)
at dk.brics.tajs.Main.main(Unknown Source)
Upon a quick glance at readme, it was evident that the analysis is limited to only one file at a time
java -jar dist/tajs-all.jar test-resources/src/google/richards.js
Is it possible to analyze an entire project (comprised of one or more files with inter procedural flow between them)
For example
java -jar dist/tajs-all.jar test-resources/nodegoat
for
https://github.com/OWASP/NodeGoat
If the project supports inter-procedural flow, I am happy to add a patch to accept a folder (to process all files) rather than an individual file.
It looks like old tool for type checking in TAJS, but exist many things with same name. Can you, please, give a link?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.