Conflicts:
	acorn.js
This commit is contained in:
Sebastian McKenzie
2014-12-10 15:24:36 +11:00
5 changed files with 9854 additions and 8523 deletions

View File

@@ -18,7 +18,7 @@
<h1>Acorn/Esprima/Traceur speed comparison</h1>
<p>This will run each of the three ES6 parsers on the source code of
jQuery 1.6.4 and CodeMirror 3.0b1 for five seconds, and show a table
jQuery 1.11.1 and CodeMirror 3.0b1 for five seconds, and show a table
indicating the number of lines parsed per second. Note that Traceur
always stores location data, and is thus not fairly compared by the
benchmark <em>without</em> location data.<p>
@@ -49,17 +49,17 @@ numbers.</p>
parser.parseScript();
}
var totalLines = codemirror30.split("\n").length + jquery164.split("\n").length;
var totalLines = codemirror30.split("\n").length + jquery111.split("\n").length;
var nowHost = (typeof performance === 'object' && 'now' in performance) ? performance : Date;
function benchmark(runner, locations) {
// Give it a chance to warm up (first runs are usually outliers)
runner(jquery164, locations);
runner(jquery111, locations);
runner(codemirror30, locations);
var t0 = nowHost.now(), t1, lines = 0;
for (;;) {
runner(jquery164, locations);
runner(jquery111, locations);
runner(codemirror30, locations);
lines += totalLines;
t1 = nowHost.now();

18242
test/jquery-string.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -14160,3 +14160,75 @@ test("(for (x of array) for (y of array2) if (x === test) x)", {
}
}]
}, {ecmaVersion: 7, preserveParens: true});
// https://github.com/marijnh/acorn/issues/161
test("import foo, * as bar from 'baz';", {
type: "Program",
body: [{
type: "ImportDeclaration",
specifiers: [
{
type: "ImportSpecifier",
id: {
type: "Identifier",
name: "foo"
},
name: null,
default: true
},
{
type: "ImportBatchSpecifier",
name: {
type: "Identifier",
name: "bar"
}
}
],
source: {
type: "Literal",
value: "baz",
raw: "'baz'"
}
}]
}, {ecmaVersion: 6});
// https://github.com/marijnh/acorn/issues/173
test("`{${x}}`, `}`", {
type: "Program",
body: [{
type: "ExpressionStatement",
expression: {
type: "SequenceExpression",
expressions: [
{
type: "TemplateLiteral",
expressions: [{
type: "Identifier",
name: "x"
}],
quasis: [
{
type: "TemplateElement",
value: {cooked: "{", raw: "{"},
tail: false
},
{
type: "TemplateElement",
value: {cooked: "}", raw: "}"},
tail: true
}
]
},
{
type: "TemplateLiteral",
expressions: [],
quasis: [{
type: "TemplateElement",
value: {cooked: "}", raw: "}"},
tail: true
}]
}
]
}
}]
}, {ecmaVersion: 6});