Comments (2)
SAFE is a framework to support implementing various JavaScript static analysis techniques and bug detectors. Thus, only basic techniques and detectors are implemented in SAFE. If you want to implement an arity checker, you can implement it by simply extending the bug detector. It currently provides 1) absent property read:
and 2) always false or true branches
as example detectors.
By the way, JavaScript allows function invocations with different arities, and some developers want to use this language feature to mimic function overloading. Therefore, I think that detecting arity mismatches as bugs might be annoying to some developers.
from safe.
SAFE ... currently provides 1) absent property read ... and 2) always false or true branches
as example detectors.
OK, yes, this works as expected, then:
function shoeSize(shoe) {
if (shoe || ~shoe) {
console.log('to be or not to be');
}
return shoe.size;
}
shoeSize({ large: true });
$ safe bugDetect buggy.js
buggy.js:
1 error:
kr.ac.kaist.safe.errors.error.IdNotBoundError: buggy.js:3:5-12: Identifier console is not bound.
No warning
buggy.js:3:5-38:
[Warning] The property "log" of the object "console["log"]('to be or not to be')" is absent.
buggy.js:2:7-11:
[Warning] The conditional expression "shoe" is always true.
The command 'bugDetect' took 1608 ms.
... I think that detecting arity mismatches as bugs might be annoying to some developers.
I was confusing SAFE with JSTAR:
JSTAR performs a type analysis and detects specification bugs using a bug detector consisting of four checkers: 1) a reference checker, 2) an arity checker, 3) an assertion checker, and 4) an operand checker. -- https://github.com/kaist-plrg/jstar/blob/main/ase21-park-jstar.pdf
from safe.
Related Issues (14)
- Failed to conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 2.a HOT 1
- Failed to conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 7.a HOT 1
- Sbt test failing giving null pointer exception. HOT 5
- document.getElementById is not implemented HOT 1
- Failed to conform to ES5.1, Section 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4 HOT 1
- User Manual not found HOT 2
- sbt compile is failing HOT 1
- Question about import cfg into the SAFE HOT 4
- analyse Error: example.js:7:8: opensquare expected HOT 4
- Sharing between arguments object and parameters HOT 1
- idea: static analysis for unexpected throws HOT 3
- Question about Cross-files invocation and analyze for functions in a certain NodeJS module HOT 4
- [Build error] Can't resolve symbol JS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safe.