Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esprima-fb

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esprima-fb - npm Package Compare versions

Comparing version 3001.1.0-dev-harmony-fb to 4001.1.0-dev-harmony-fb

20

package.json

@@ -10,6 +10,19 @@ {

},
"version": "3001.0001.0000-dev-harmony-fb",
"version": "4001.0001.0000-dev-harmony-fb",
"files": [
"bin",
"test/run.js",
"test/runner.js",
"test/test.js",
"test/compat.js",
"test/reflect.js",
"esprima.js"
],
"engines": {
"node": ">=0.4.0"
},
"author": {
"name": "Ariya Hidayat",
"email": "ariya.hidayat@gmail.com"
},
"maintainers": [{

@@ -24,2 +37,5 @@ "name": "Jeff Morrison",

},
"bugs": {
"url": "http://issues.esprima.org"
},
"licenses": [{

@@ -40,3 +56,3 @@ "type": "BSD",

"test": "npm run-script lint && node test/run.js && npm run-script coverage && npm run-script complexity",
"lint": "node tools/check-version.js && node_modules/eslint/bin/eslint.js esprima.js && node_modules/jslint/bin/jslint.js esprima.js",
"lint": "node tools/check-version.js && node node_modules/eslint/bin/eslint.js esprima.js && node node_modules/jslint/bin/jslint.js esprima.js",
"coverage": "npm run-script analyze-coverage && npm run-script check-coverage",

@@ -43,0 +59,0 @@ "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js",

2

test/reflect.js

@@ -90,3 +90,3 @@ // This is modified from Mozilla Reflect.parse test suite (the file is located

function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg }) }
function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) }
function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) }

@@ -93,0 +93,0 @@ function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) }

@@ -74,2 +74,24 @@ /*

function needLoc(syntax) {
var need = true;
if (typeof syntax.tokens !== 'undefined' && syntax.tokens.length > 0) {
need = (typeof syntax.tokens[0].loc !== 'undefined');
}
if (typeof syntax.comments !== 'undefined' && syntax.comments.length > 0) {
need = (typeof syntax.comments[0].loc !== 'undefined');
}
return need;
}
function needRange(syntax) {
var need = true;
if (typeof syntax.tokens !== 'undefined' && syntax.tokens.length > 0) {
need = (typeof syntax.tokens[0].range !== 'undefined');
}
if (typeof syntax.comments !== 'undefined' && syntax.comments.length > 0) {
need = (typeof syntax.comments[0].range !== 'undefined');
}
return need;
}
function testParse(esprima, code, syntax) {

@@ -84,4 +106,4 @@ 'use strict';

comment: (typeof syntax.comments !== 'undefined'),
range: true,
loc: true,
range: needRange(syntax),
loc: needLoc(syntax),
tokens: (typeof syntax.tokens !== 'undefined'),

@@ -93,16 +115,2 @@ raw: true,

if (typeof syntax.tokens !== 'undefined') {
if (syntax.tokens.length > 0) {
options.range = (typeof syntax.tokens[0].range !== 'undefined');
options.loc = (typeof syntax.tokens[0].loc !== 'undefined');
}
}
if (typeof syntax.comments !== 'undefined') {
if (syntax.comments.length > 0) {
options.range = (typeof syntax.comments[0].range !== 'undefined');
options.loc = (typeof syntax.comments[0].loc !== 'undefined');
}
}
if (options.loc) {

@@ -170,2 +178,25 @@ options.source = syntax.loc.source;

function mustHaveLocRange(testName, node, needLoc, needRange, stack) {
var error;
if (node.hasOwnProperty('type')) {
if (needLoc && !node.loc) {
error = "doesn't have 'loc' property";
}
if (needRange && !node.range) {
error = "doesn't have 'range' property";
}
if (error) {
stack = stack.length ? ' at [' + stack.join('][') + ']' : '';
throw new Error("Test '" + testName + "'" + stack + " (type = " + node.type + ") " + error);
}
}
for (i in node) {
if (node.hasOwnProperty(i) && node[i] !== null && typeof node[i] === 'object') {
stack.push(i);
mustHaveLocRange(testName, node[i], needLoc, needRange, stack);
stack.pop();
}
}
}
function testTokenize(esprima, code, tokens) {

@@ -415,2 +446,5 @@ 'use strict';

expected = testFixture[category][source];
if (!expected.hasOwnProperty('lineNumber') && !expected.hasOwnProperty('result')) {
mustHaveLocRange(source, expected, needLoc(expected), needRange(expected), []);
}
try {

@@ -417,0 +451,0 @@ runTest(esprima, source, expected);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc