first commit
This commit is contained in:
174
build/node_modules/esprima/ChangeLog
generated
vendored
Normal file
174
build/node_modules/esprima/ChangeLog
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
2016-08-23: Version 2.7.3
|
||||
|
||||
* Fix tokenizer confusion with a comment (issue 1493, 1516)
|
||||
|
||||
2016-02-02: Version 2.7.2
|
||||
|
||||
* Fix out-of-bound error location in an invalid string literal (issue 1457)
|
||||
* Fix shorthand object destructuring defaults in variable declarations (issue 1459)
|
||||
|
||||
2015-12-10: Version 2.7.1
|
||||
|
||||
* Do not allow trailing comma in a variable declaration (issue 1360)
|
||||
* Fix assignment to `let` in non-strict mode (issue 1376)
|
||||
* Fix missing delegate property in YieldExpression (issue 1407)
|
||||
|
||||
2015-10-22: Version 2.7.0
|
||||
|
||||
* Fix the handling of semicolon in a break statement (issue 1044)
|
||||
* Run the test suite with major web browsers (issue 1259, 1317)
|
||||
* Allow `let` as an identifier in non-strict mode (issue 1289)
|
||||
* Attach orphaned comments as `innerComments` (issue 1328)
|
||||
* Add the support for token delegator (issue 1332)
|
||||
|
||||
2015-09-01: Version 2.6.0
|
||||
|
||||
* Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098)
|
||||
* Add sourceType field for Program node (issue 1159)
|
||||
* Ensure that strict mode reserved word binding throw an error (issue 1171)
|
||||
* Run the test suite with Node.js and IE 11 on Windows (issue 1294)
|
||||
* Allow binding pattern with no initializer in a for statement (issue 1301)
|
||||
|
||||
2015-07-31: Version 2.5.0
|
||||
|
||||
* Run the test suite in a browser environment (issue 1004)
|
||||
* Ensure a comma between imported default binding and named imports (issue 1046)
|
||||
* Distinguish `yield` as a keyword vs an identifier (issue 1186)
|
||||
* Support ES6 meta property `new.target` (issue 1203)
|
||||
* Fix the syntax node for yield with expression (issue 1223)
|
||||
* Fix the check of duplicated proto in property names (issue 1225)
|
||||
* Fix ES6 Unicode escape in identifier name (issue 1229)
|
||||
* Support ES6 IdentifierStart and IdentifierPart (issue 1232)
|
||||
* Treat await as a reserved word when parsing as a module (issue 1234)
|
||||
* Recognize identifier characters from Unicode SMP (issue 1244)
|
||||
* Ensure that export and import can be followed by a comma (issue 1250)
|
||||
* Fix yield operator precedence (issue 1262)
|
||||
|
||||
2015-07-01: Version 2.4.1
|
||||
|
||||
* Fix some cases of comment attachment (issue 1071, 1175)
|
||||
* Fix the handling of destructuring in function arguments (issue 1193)
|
||||
* Fix invalid ranges in assignment expression (issue 1201)
|
||||
|
||||
2015-06-26: Version 2.4.0
|
||||
|
||||
* Support ES6 for-of iteration (issue 1047)
|
||||
* Support ES6 spread arguments (issue 1169)
|
||||
* Minimize npm payload (issue 1191)
|
||||
|
||||
2015-06-16: Version 2.3.0
|
||||
|
||||
* Support ES6 generator (issue 1033)
|
||||
* Improve parsing of regular expressions with `u` flag (issue 1179)
|
||||
|
||||
2015-04-17: Version 2.2.0
|
||||
|
||||
* Support ES6 import and export declarations (issue 1000)
|
||||
* Fix line terminator before arrow not recognized as error (issue 1009)
|
||||
* Support ES6 destructuring (issue 1045)
|
||||
* Support ES6 template literal (issue 1074)
|
||||
* Fix the handling of invalid/incomplete string escape sequences (issue 1106)
|
||||
* Fix ES3 static member access restriction (issue 1120)
|
||||
* Support for `super` in ES6 class (issue 1147)
|
||||
|
||||
2015-03-09: Version 2.1.0
|
||||
|
||||
* Support ES6 class (issue 1001)
|
||||
* Support ES6 rest parameter (issue 1011)
|
||||
* Expand the location of property getter, setter, and methods (issue 1029)
|
||||
* Enable TryStatement transition to a single handler (issue 1031)
|
||||
* Support ES6 computed property name (issue 1037)
|
||||
* Tolerate unclosed block comment (issue 1041)
|
||||
* Support ES6 lexical declaration (issue 1065)
|
||||
|
||||
2015-02-06: Version 2.0.0
|
||||
|
||||
* Support ES6 arrow function (issue 517)
|
||||
* Support ES6 Unicode code point escape (issue 521)
|
||||
* Improve the speed and accuracy of comment attachment (issue 522)
|
||||
* Support ES6 default parameter (issue 519)
|
||||
* Support ES6 regular expression flags (issue 557)
|
||||
* Fix scanning of implicit octal literals (issue 565)
|
||||
* Fix the handling of automatic semicolon insertion (issue 574)
|
||||
* Support ES6 method definition (issue 620)
|
||||
* Support ES6 octal integer literal (issue 621)
|
||||
* Support ES6 binary integer literal (issue 622)
|
||||
* Support ES6 object literal property value shorthand (issue 624)
|
||||
|
||||
2015-03-03: Version 1.2.5
|
||||
|
||||
* Fix scanning of implicit octal literals (issue 565)
|
||||
|
||||
2015-02-05: Version 1.2.4
|
||||
|
||||
* Fix parsing of LeftHandSideExpression in ForInStatement (issue 560)
|
||||
* Fix the handling of automatic semicolon insertion (issue 574)
|
||||
|
||||
2015-01-18: Version 1.2.3
|
||||
|
||||
* Fix division by this (issue 616)
|
||||
|
||||
2014-05-18: Version 1.2.2
|
||||
|
||||
* Fix duplicated tokens when collecting comments (issue 537)
|
||||
|
||||
2014-05-04: Version 1.2.1
|
||||
|
||||
* Ensure that Program node may still have leading comments (issue 536)
|
||||
|
||||
2014-04-29: Version 1.2.0
|
||||
|
||||
* Fix semicolon handling for expression statement (issue 462, 533)
|
||||
* Disallow escaped characters in regular expression flags (issue 503)
|
||||
* Performance improvement for location tracking (issue 520)
|
||||
* Improve the speed of comment attachment (issue 522)
|
||||
|
||||
2014-03-26: Version 1.1.1
|
||||
|
||||
* Fix token handling of forward slash after an array literal (issue 512)
|
||||
|
||||
2014-03-23: Version 1.1.0
|
||||
|
||||
* Optionally attach comments to the owning syntax nodes (issue 197)
|
||||
* Simplify binary parsing with stack-based shift reduce (issue 352)
|
||||
* Always include the raw source of literals (issue 376)
|
||||
* Add optional input source information (issue 386)
|
||||
* Tokenizer API for pure lexical scanning (issue 398)
|
||||
* Improve the web site and its online demos (issue 337, 400, 404)
|
||||
* Performance improvement for location tracking (issue 417, 424)
|
||||
* Support HTML comment syntax (issue 451)
|
||||
* Drop support for legacy browsers (issue 474)
|
||||
|
||||
2013-08-27: Version 1.0.4
|
||||
|
||||
* Minimize the payload for packages (issue 362)
|
||||
* Fix missing cases on an empty switch statement (issue 436)
|
||||
* Support escaped ] in regexp literal character classes (issue 442)
|
||||
* Tolerate invalid left-hand side expression (issue 130)
|
||||
|
||||
2013-05-17: Version 1.0.3
|
||||
|
||||
* Variable declaration needs at least one declarator (issue 391)
|
||||
* Fix benchmark's variance unit conversion (issue 397)
|
||||
* IE < 9: \v should be treated as vertical tab (issue 405)
|
||||
* Unary expressions should always have prefix: true (issue 418)
|
||||
* Catch clause should only accept an identifier (issue 423)
|
||||
* Tolerate setters without parameter (issue 426)
|
||||
|
||||
2012-11-02: Version 1.0.2
|
||||
|
||||
Improvement:
|
||||
|
||||
* Fix esvalidate JUnit output upon a syntax error (issue 374)
|
||||
|
||||
2012-10-28: Version 1.0.1
|
||||
|
||||
Improvements:
|
||||
|
||||
* esvalidate understands shebang in a Unix shell script (issue 361)
|
||||
* esvalidate treats fatal parsing failure as an error (issue 361)
|
||||
* Reduce Node.js package via .npmignore (issue 362)
|
||||
|
||||
2012-10-22: Version 1.0.0
|
||||
|
||||
Initial release.
|
||||
21
build/node_modules/esprima/LICENSE.BSD
generated
vendored
Normal file
21
build/node_modules/esprima/LICENSE.BSD
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
27
build/node_modules/esprima/README.md
generated
vendored
Normal file
27
build/node_modules/esprima/README.md
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
[](https://www.npmjs.com/package/esprima)
|
||||
[](https://www.npmjs.com/package/esprima)
|
||||
[](https://travis-ci.org/jquery/esprima)
|
||||
[](https://codecov.io/github/jquery/esprima)
|
||||
|
||||
**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,
|
||||
standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
|
||||
parser written in ECMAScript (also popularly known as
|
||||
[JavaScript](https://en.wikipedia.org/wiki/JavaScript)).
|
||||
Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat),
|
||||
with the help of [many contributors](https://github.com/jquery/esprima/contributors).
|
||||
|
||||
### Features
|
||||
|
||||
- Full support for ECMAScript 6 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
|
||||
- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/spec.md) as standardized by [ESTree project](https://github.com/estree/estree)
|
||||
- Optional tracking of syntax node location (index-based and line-column)
|
||||
- [Heavily tested](http://esprima.org/test/ci.html) (~1250 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima))
|
||||
|
||||
Esprima serves as a **building block** for some JavaScript
|
||||
language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html)
|
||||
to [editor autocompletion](http://esprima.org/demo/autocomplete.html).
|
||||
|
||||
Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as
|
||||
[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima).
|
||||
|
||||
For more information, check the web site [esprima.org](http://esprima.org).
|
||||
126
build/node_modules/esprima/bin/esparse.js
generated
vendored
Executable file
126
build/node_modules/esprima/bin/esparse.js
generated
vendored
Executable file
@@ -0,0 +1,126 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*jslint sloppy:true node:true rhino:true */
|
||||
|
||||
var fs, esprima, fname, content, options, syntax;
|
||||
|
||||
if (typeof require === 'function') {
|
||||
fs = require('fs');
|
||||
esprima = require('esprima');
|
||||
} else if (typeof load === 'function') {
|
||||
try {
|
||||
load('esprima.js');
|
||||
} catch (e) {
|
||||
load('../esprima.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Shims to Node.js objects when running under Rhino.
|
||||
if (typeof console === 'undefined' && typeof process === 'undefined') {
|
||||
console = { log: print };
|
||||
fs = { readFileSync: readFile };
|
||||
process = { argv: arguments, exit: quit };
|
||||
process.argv.unshift('esparse.js');
|
||||
process.argv.unshift('rhino');
|
||||
}
|
||||
|
||||
function showUsage() {
|
||||
console.log('Usage:');
|
||||
console.log(' esparse [options] file.js');
|
||||
console.log();
|
||||
console.log('Available options:');
|
||||
console.log();
|
||||
console.log(' --comment Gather all line and block comments in an array');
|
||||
console.log(' --loc Include line-column location info for each syntax node');
|
||||
console.log(' --range Include index-based range for each syntax node');
|
||||
console.log(' --raw Display the raw value of literals');
|
||||
console.log(' --tokens List all tokens in an array');
|
||||
console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
|
||||
console.log(' -v, --version Shows program version');
|
||||
console.log();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (process.argv.length <= 2) {
|
||||
showUsage();
|
||||
}
|
||||
|
||||
options = {};
|
||||
|
||||
process.argv.splice(2).forEach(function (entry) {
|
||||
|
||||
if (entry === '-h' || entry === '--help') {
|
||||
showUsage();
|
||||
} else if (entry === '-v' || entry === '--version') {
|
||||
console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
|
||||
console.log();
|
||||
process.exit(0);
|
||||
} else if (entry === '--comment') {
|
||||
options.comment = true;
|
||||
} else if (entry === '--loc') {
|
||||
options.loc = true;
|
||||
} else if (entry === '--range') {
|
||||
options.range = true;
|
||||
} else if (entry === '--raw') {
|
||||
options.raw = true;
|
||||
} else if (entry === '--tokens') {
|
||||
options.tokens = true;
|
||||
} else if (entry === '--tolerant') {
|
||||
options.tolerant = true;
|
||||
} else if (entry.slice(0, 2) === '--') {
|
||||
console.log('Error: unknown option ' + entry + '.');
|
||||
process.exit(1);
|
||||
} else if (typeof fname === 'string') {
|
||||
console.log('Error: more than one input file.');
|
||||
process.exit(1);
|
||||
} else {
|
||||
fname = entry;
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof fname !== 'string') {
|
||||
console.log('Error: no input file.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Special handling for regular expression literal since we need to
|
||||
// convert it to a string literal, otherwise it will be decoded
|
||||
// as object "{}" and the regular expression would be lost.
|
||||
function adjustRegexLiteral(key, value) {
|
||||
if (key === 'value' && value instanceof RegExp) {
|
||||
value = value.toString();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
try {
|
||||
content = fs.readFileSync(fname, 'utf-8');
|
||||
syntax = esprima.parse(content, options);
|
||||
console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
|
||||
} catch (e) {
|
||||
console.log('Error: ' + e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
199
build/node_modules/esprima/bin/esvalidate.js
generated
vendored
Executable file
199
build/node_modules/esprima/bin/esvalidate.js
generated
vendored
Executable file
@@ -0,0 +1,199 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*jslint sloppy:true plusplus:true node:true rhino:true */
|
||||
/*global phantom:true */
|
||||
|
||||
var fs, system, esprima, options, fnames, count;
|
||||
|
||||
if (typeof esprima === 'undefined') {
|
||||
// PhantomJS can only require() relative files
|
||||
if (typeof phantom === 'object') {
|
||||
fs = require('fs');
|
||||
system = require('system');
|
||||
esprima = require('./esprima');
|
||||
} else if (typeof require === 'function') {
|
||||
fs = require('fs');
|
||||
esprima = require('esprima');
|
||||
} else if (typeof load === 'function') {
|
||||
try {
|
||||
load('esprima.js');
|
||||
} catch (e) {
|
||||
load('../esprima.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Shims to Node.js objects when running under PhantomJS 1.7+.
|
||||
if (typeof phantom === 'object') {
|
||||
fs.readFileSync = fs.read;
|
||||
process = {
|
||||
argv: [].slice.call(system.args),
|
||||
exit: phantom.exit
|
||||
};
|
||||
process.argv.unshift('phantomjs');
|
||||
}
|
||||
|
||||
// Shims to Node.js objects when running under Rhino.
|
||||
if (typeof console === 'undefined' && typeof process === 'undefined') {
|
||||
console = { log: print };
|
||||
fs = { readFileSync: readFile };
|
||||
process = { argv: arguments, exit: quit };
|
||||
process.argv.unshift('esvalidate.js');
|
||||
process.argv.unshift('rhino');
|
||||
}
|
||||
|
||||
function showUsage() {
|
||||
console.log('Usage:');
|
||||
console.log(' esvalidate [options] file.js');
|
||||
console.log();
|
||||
console.log('Available options:');
|
||||
console.log();
|
||||
console.log(' --format=type Set the report format, plain (default) or junit');
|
||||
console.log(' -v, --version Print program version');
|
||||
console.log();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (process.argv.length <= 2) {
|
||||
showUsage();
|
||||
}
|
||||
|
||||
options = {
|
||||
format: 'plain'
|
||||
};
|
||||
|
||||
fnames = [];
|
||||
|
||||
process.argv.splice(2).forEach(function (entry) {
|
||||
|
||||
if (entry === '-h' || entry === '--help') {
|
||||
showUsage();
|
||||
} else if (entry === '-v' || entry === '--version') {
|
||||
console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
|
||||
console.log();
|
||||
process.exit(0);
|
||||
} else if (entry.slice(0, 9) === '--format=') {
|
||||
options.format = entry.slice(9);
|
||||
if (options.format !== 'plain' && options.format !== 'junit') {
|
||||
console.log('Error: unknown report format ' + options.format + '.');
|
||||
process.exit(1);
|
||||
}
|
||||
} else if (entry.slice(0, 2) === '--') {
|
||||
console.log('Error: unknown option ' + entry + '.');
|
||||
process.exit(1);
|
||||
} else {
|
||||
fnames.push(entry);
|
||||
}
|
||||
});
|
||||
|
||||
if (fnames.length === 0) {
|
||||
console.log('Error: no input file.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (options.format === 'junit') {
|
||||
console.log('<?xml version="1.0" encoding="UTF-8"?>');
|
||||
console.log('<testsuites>');
|
||||
}
|
||||
|
||||
count = 0;
|
||||
fnames.forEach(function (fname) {
|
||||
var content, timestamp, syntax, name;
|
||||
try {
|
||||
content = fs.readFileSync(fname, 'utf-8');
|
||||
|
||||
if (content[0] === '#' && content[1] === '!') {
|
||||
content = '//' + content.substr(2, content.length);
|
||||
}
|
||||
|
||||
timestamp = Date.now();
|
||||
syntax = esprima.parse(content, { tolerant: true });
|
||||
|
||||
if (options.format === 'junit') {
|
||||
|
||||
name = fname;
|
||||
if (name.lastIndexOf('/') >= 0) {
|
||||
name = name.slice(name.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
console.log('<testsuite name="' + fname + '" errors="0" ' +
|
||||
' failures="' + syntax.errors.length + '" ' +
|
||||
' tests="' + syntax.errors.length + '" ' +
|
||||
' time="' + Math.round((Date.now() - timestamp) / 1000) +
|
||||
'">');
|
||||
|
||||
syntax.errors.forEach(function (error) {
|
||||
var msg = error.message;
|
||||
msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
|
||||
console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
|
||||
' time="0">');
|
||||
console.log(' <error type="SyntaxError" message="' + error.message + '">' +
|
||||
error.message + '(' + name + ':' + error.lineNumber + ')' +
|
||||
'</error>');
|
||||
console.log(' </testcase>');
|
||||
});
|
||||
|
||||
console.log('</testsuite>');
|
||||
|
||||
} else if (options.format === 'plain') {
|
||||
|
||||
syntax.errors.forEach(function (error) {
|
||||
var msg = error.message;
|
||||
msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
|
||||
msg = fname + ':' + error.lineNumber + ': ' + msg;
|
||||
console.log(msg);
|
||||
++count;
|
||||
});
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
++count;
|
||||
if (options.format === 'junit') {
|
||||
console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
|
||||
' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
|
||||
console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
|
||||
console.log(' <error type="ParseError" message="' + e.message + '">' +
|
||||
e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
|
||||
')</error>');
|
||||
console.log(' </testcase>');
|
||||
console.log('</testsuite>');
|
||||
} else {
|
||||
console.log('Error: ' + e.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (options.format === 'junit') {
|
||||
console.log('</testsuites>');
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (count === 0 && typeof phantom === 'object') {
|
||||
process.exit(0);
|
||||
}
|
||||
5740
build/node_modules/esprima/esprima.js
generated
vendored
Normal file
5740
build/node_modules/esprima/esprima.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
127
build/node_modules/esprima/package.json
generated
vendored
Normal file
127
build/node_modules/esprima/package.json
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"esprima@2.7.3",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "esprima@2.7.3",
|
||||
"_id": "esprima@2.7.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
|
||||
"_location": "/esprima",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "esprima@2.7.3",
|
||||
"name": "esprima",
|
||||
"escapedName": "esprima",
|
||||
"rawSpec": "2.7.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.7.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/js-yaml"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
|
||||
"_spec": "2.7.3",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Ariya Hidayat",
|
||||
"email": "ariya.hidayat@gmail.com"
|
||||
},
|
||||
"bin": {
|
||||
"esparse": "./bin/esparse.js",
|
||||
"esvalidate": "./bin/esvalidate.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jquery/esprima/issues"
|
||||
},
|
||||
"description": "ECMAScript parsing infrastructure for multipurpose analysis",
|
||||
"devDependencies": {
|
||||
"codecov.io": "~0.1.6",
|
||||
"escomplex-js": "1.2.0",
|
||||
"eslint": "~1.7.2",
|
||||
"everything.js": "~1.0.3",
|
||||
"glob": "^5.0.15",
|
||||
"istanbul": "~0.4.0",
|
||||
"jscs": "~2.3.5",
|
||||
"json-diff": "~0.3.1",
|
||||
"karma": "^0.13.11",
|
||||
"karma-chrome-launcher": "^0.2.1",
|
||||
"karma-detect-browsers": "^2.0.2",
|
||||
"karma-firefox-launcher": "^0.1.6",
|
||||
"karma-ie-launcher": "^0.2.0",
|
||||
"karma-mocha": "^0.2.0",
|
||||
"karma-safari-launcher": "^0.1.1",
|
||||
"karma-sauce-launcher": "^0.2.14",
|
||||
"lodash": "^3.10.0",
|
||||
"mocha": "^2.3.3",
|
||||
"node-tick-processor": "~0.0.2",
|
||||
"regenerate": "~1.2.1",
|
||||
"temp": "~0.8.3",
|
||||
"unicode-7.0.0": "~0.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"unit-tests.js",
|
||||
"esprima.js"
|
||||
],
|
||||
"homepage": "http://esprima.org",
|
||||
"keywords": [
|
||||
"ast",
|
||||
"ecmascript",
|
||||
"javascript",
|
||||
"parser",
|
||||
"syntax"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "esprima.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Ariya Hidayat",
|
||||
"email": "ariya.hidayat@gmail.com",
|
||||
"url": "http://ariya.ofilabs.com"
|
||||
}
|
||||
],
|
||||
"name": "esprima",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jquery/esprima.git"
|
||||
},
|
||||
"scripts": {
|
||||
"all-tests": "npm run generate-fixtures && npm run unit-tests && npm run grammar-tests && npm run regression-tests",
|
||||
"analyze-coverage": "istanbul cover test/unit-tests.js",
|
||||
"appveyor": "npm run all-tests && npm run browser-tests && npm run dynamic-analysis",
|
||||
"benchmark": "node test/benchmarks.js",
|
||||
"benchmark-quick": "node test/benchmarks.js quick",
|
||||
"browser-tests": "npm run generate-fixtures && cd test && karma start --single-run",
|
||||
"check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100",
|
||||
"check-version": "node test/check-version.js",
|
||||
"circleci": "npm test && npm run codecov && npm run downstream",
|
||||
"codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml",
|
||||
"complexity": "node test/check-complexity.js",
|
||||
"downstream": "node test/downstream.js",
|
||||
"droneio": "npm test && npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari",
|
||||
"dynamic-analysis": "npm run analyze-coverage && npm run check-coverage",
|
||||
"eslint": "node node_modules/eslint/bin/eslint.js -c .lintrc esprima.js",
|
||||
"generate-fixtures": "node tools/generate-fixtures.js",
|
||||
"generate-regex": "node tools/generate-identifier-regex.js",
|
||||
"grammar-tests": "node test/grammar-tests.js",
|
||||
"jscs": "jscs -p crockford esprima.js && jscs -p crockford test/*.js",
|
||||
"profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor",
|
||||
"regression-tests": "node test/regression-tests.js",
|
||||
"saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js",
|
||||
"saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js",
|
||||
"saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js",
|
||||
"static-analysis": "npm run check-version && npm run jscs && npm run eslint && npm run complexity",
|
||||
"test": "npm run all-tests && npm run static-analysis && npm run dynamic-analysis",
|
||||
"travis": "npm test",
|
||||
"unit-tests": "node test/unit-tests.js"
|
||||
},
|
||||
"version": "2.7.3"
|
||||
}
|
||||
Reference in New Issue
Block a user