move acorn into vendor

This commit is contained in:
Sebastian McKenzie
2015-03-18 19:01:30 +11:00
parent 16e8224ce6
commit 57af08bea8
9 changed files with 18541 additions and 110 deletions

View File

@@ -33,7 +33,7 @@
else callback("fail", test.code,
"Expected error message: " + test.error + "\nGot error message: " + e.message);
} else {
callback("error", test.code, e.message || e.toString());
callback("error", test.code, e.stack || e.toString());
}
continue
}

View File

@@ -5,6 +5,9 @@
driver = require("./driver.js");
require("./tests.js");
require("./tests-harmony.js");
require("./tests-flow.js");
require("./tests-babel.js");
require("./tests-jsx.js");
} else {
driver = window;
}
@@ -49,17 +52,6 @@
config: {
parse: (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse
}
},
Loose: {
config: {
parse: (typeof require === "undefined" ? window.acorn : require("../acorn_loose")).parse_dammit,
loose: true,
filter: function (test) {
var opts = test.options || {};
if (opts.loose === false) return false;
return (opts.ecmaVersion || 5) <= 6;
}
}
}
};

2057
test/tests-babel.js Normal file

File diff suppressed because it is too large Load Diff

11125
test/tests-flow.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6560,7 +6560,7 @@ test("class A {get() {}}", {
end: {line: 1, column: 17}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 9},
@@ -6632,7 +6632,7 @@ test("class A { static get() {}}", {
end: {line: 1, column: 25}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 10},
@@ -7027,7 +7027,7 @@ test("class A {set(v) {};}", {
end: {line: 1, column: 18}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 9},
@@ -7106,7 +7106,7 @@ test("class A { static set(v) {};}", {
end: {line: 1, column: 26}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 10},
@@ -7207,7 +7207,7 @@ test("class A {*gen(v) { yield v; }}", {
end: {line: 1, column: 29}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 9},
@@ -7308,7 +7308,7 @@ test("class A { static *gen(v) { yield v; }}", {
end: {line: 1, column: 37}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 10},
@@ -7391,8 +7391,7 @@ test("\"use strict\"; (class A {constructor() { super() }})", {
expression: {
type: "CallExpression",
callee: {
type: "Identifier",
name: "super",
type: "SuperExpression",
loc: {
start: {line: 1, column: 40},
end: {line: 1, column: 45}
@@ -7421,7 +7420,7 @@ test("\"use strict\"; (class A {constructor() { super() }})", {
end: {line: 1, column: 49}
}
},
kind: "",
kind: "constructor",
static: false,
loc: {
start: {line: 1, column: 24},
@@ -7454,6 +7453,36 @@ test("\"use strict\"; (class A {constructor() { super() }})", {
locations: true
});
test("class A {'constructor'() {}}", {
type: "Program",
body: [{
type: "ClassDeclaration",
id: {type: "Identifier", name: "A"},
superClass: null,
body: {
type: "ClassBody",
body: [{
type: "MethodDefinition",
computed: false,
key: {type: "Literal", value: "constructor"},
static: false,
kind: "constructor",
value: {
type: "FunctionExpression",
id: null,
generator: false,
expression: false,
params: [],
body: {
type: "BlockStatement",
body: []
}
}
}]
}
}]
}, {ecmaVersion: 6});
test("class A {static foo() {}}", {
type: "Program",
body: [{
@@ -7499,7 +7528,7 @@ test("class A {static foo() {}}", {
end: {line: 1, column: 24}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 9},
@@ -7572,7 +7601,7 @@ test("class A {foo() {} static bar() {}}", {
end: {line: 1, column: 17}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 9},
@@ -7609,7 +7638,7 @@ test("class A {foo() {} static bar() {}}", {
end: {line: 1, column: 33}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 18},
@@ -7693,8 +7722,7 @@ test("\"use strict\"; (class A { static constructor() { super() }})", {
expression: {
type: "CallExpression",
callee: {
type: "Identifier",
name: "super",
type: "SuperExpression",
loc: {
start: {line: 1, column: 48},
end: {line: 1, column: 53}
@@ -7723,7 +7751,7 @@ test("\"use strict\"; (class A { static constructor() { super() }})", {
end: {line: 1, column: 57}
}
},
kind: "",
kind: "method",
static: true,
loc: {
start: {line: 1, column: 25},
@@ -7802,7 +7830,7 @@ test("class A { foo() {} bar() {}}", {
end: {line: 1, column: 18}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 10},
@@ -7839,7 +7867,7 @@ test("class A { foo() {} bar() {}}", {
end: {line: 1, column: 27}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 19},
@@ -8450,7 +8478,7 @@ test("class A { static [foo]() {} }", {
},
name: "foo"
},
kind: "",
kind: "method",
value: {
type: "FunctionExpression",
loc: {
@@ -8717,7 +8745,7 @@ test("class A { foo() {} get foo() {} }",{
},
name: "foo"
},
kind: "",
kind: "method",
value: {
type: "FunctionExpression",
loc: {
@@ -9582,7 +9610,7 @@ test("class A {[x]() {}}", {
},
name: "x"
},
kind: "",
kind: "method",
value: {
type: "FunctionExpression",
loc: {
@@ -10324,7 +10352,7 @@ test("(class {f({x} = {x: 10}) {}})", {
end: {line: 1, column: 27}
}
},
kind: "",
kind: "method",
static: false,
loc: {
start: {line: 1, column: 8},
@@ -14947,7 +14975,7 @@ test("class A { static() {} }", {
name: "static"
},
static: false,
kind: "",
kind: "method",
value: {
type: "FunctionExpression",
range: [16, 21],
@@ -15044,7 +15072,7 @@ test("class A { *static() {} }", {
name: "static"
},
static: false,
kind: "",
kind: "method",
value: {
type: "FunctionExpression",
range: [17, 22],

3647
test/tests-jsx.js Normal file

File diff suppressed because it is too large Load Diff