Conflicts:
	acorn.js
This commit is contained in:
Sebastian McKenzie
2015-01-23 23:16:08 +11:00
2 changed files with 58 additions and 4 deletions

View File

@@ -28862,3 +28862,48 @@ test("#!/usr/bin/node\n;", {}, {
end: 15
}]
});
// https://github.com/marijnh/acorn/issues/204
test("(function () {} / 1)", {
type: "Program",
body: [{
type: "ExpressionStatement",
expression: {
type: "BinaryExpression",
left: {
type: "FunctionExpression",
id: null,
params: [],
body: {
type: "BlockStatement",
body: []
}
},
operator: "/",
right: {type: "Literal", value: 1}
}
}]
});
test("function f() {} / 1 /", {
type: "Program",
body: [
{
type: "FunctionDeclaration",
id: {type: "Identifier", name: "f"},
params: [],
body: {
type: "BlockStatement",
body: []
}
},
{
type: "ExpressionStatement",
expression: {
type: "Literal",
regex: {pattern: " 1 ", flags: ""},
value: {}
}
}
]
});