acorn-6to5
Advanced tools
Comparing version 0.11.1-16 to 0.11.1-17
@@ -5,3 +5,3 @@ { | ||
"main": "acorn_csp.js", | ||
"version": "0.11.1-16", | ||
"version": "0.11.1-17", | ||
"maintainers": [ | ||
@@ -8,0 +8,0 @@ { |
@@ -200,3 +200,5 @@ if (typeof exports != "undefined") { | ||
testFail("obj ?= 2;", "You can only use member expressions in memoization assignment (1:0)"); | ||
testFail("obj ?= 2;", "You can only use member expressions in memoization assignment (1:0)", { | ||
playground: true | ||
}); | ||
@@ -247,2 +249,79 @@ test("obj.x ?= 2;", { | ||
test("x ||= 2;", { | ||
type: "Program", | ||
start: 0, | ||
end: 8, | ||
body: [{ | ||
type: "ExpressionStatement", | ||
start: 0, | ||
end: 8, | ||
expression: { | ||
type: "AssignmentExpression", | ||
start: 0, | ||
end: 7, | ||
left: { | ||
type: "Identifier", | ||
start: 0, | ||
end: 1 | ||
}, | ||
right: { | ||
type: "Literal", | ||
start: 6, | ||
end: 7, | ||
value: 2, | ||
raw: "2" | ||
}, | ||
operator: "||=" | ||
} | ||
}] | ||
}, { | ||
playground: true | ||
}); | ||
test("obj.x ||= 2;", { | ||
type: "Program", | ||
start: 0, | ||
end: 12, | ||
body: [{ | ||
type: "ExpressionStatement", | ||
start: 0, | ||
end: 12, | ||
expression: { | ||
type: "AssignmentExpression", | ||
start: 0, | ||
end: 11, | ||
left: { | ||
type: "MemberExpression", | ||
start: 0, | ||
end: 5, | ||
object: { | ||
type: "Identifier", | ||
start: 0, | ||
end: 3, | ||
name: "obj" | ||
}, | ||
property: { | ||
type: "Identifier", | ||
start: 4, | ||
end: 5, | ||
name: "x" | ||
}, | ||
computed: false | ||
}, | ||
right: { | ||
type: "Literal", | ||
start: 10, | ||
end: 11, | ||
value: 2, | ||
raw: "2" | ||
}, | ||
operator: "||=" | ||
} | ||
}] | ||
}, { | ||
playground: true | ||
}); | ||
// Method binding | ||
@@ -249,0 +328,0 @@ |
@@ -83,2 +83,128 @@ if (typeof exports != "undefined") { | ||
test("2 ** (3 ** 2)", { | ||
type: "Program", | ||
body: [{ | ||
type: "ExpressionStatement", | ||
expression: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 2 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 3 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "Literal", | ||
value: 2 | ||
} | ||
} | ||
} | ||
}] | ||
}, { | ||
ecmaVersion: 7 | ||
}); | ||
test("2 ** 3 ** 2", { | ||
type: "Program", | ||
body: [{ | ||
type: "ExpressionStatement", | ||
expression: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 2 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 3 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "Literal", | ||
value: 2 | ||
} | ||
} | ||
} | ||
}] | ||
}, { | ||
ecmaVersion: 7 | ||
}); | ||
test("(2 ** -1) * 2", { | ||
type: "Program", | ||
body: [{ | ||
type: "ExpressionStatement", | ||
expression: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 2 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "UnaryExpression", | ||
operator: "-", | ||
prefix: true, | ||
argument: { | ||
type: "Literal", | ||
value: 1 | ||
} | ||
} | ||
}, | ||
operator: "*", | ||
right: { | ||
type: "Literal", | ||
value: 2 | ||
} | ||
} | ||
}] | ||
}, { | ||
ecmaVersion: 7 | ||
}); | ||
test("2 ** -1 * 2", { | ||
type: "Program", | ||
body: [{ | ||
type: "ExpressionStatement", | ||
expression: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "BinaryExpression", | ||
left: { | ||
type: "Literal", | ||
value: 2 | ||
}, | ||
operator: "**", | ||
right: { | ||
type: "UnaryExpression", | ||
operator: "-", | ||
prefix: true, | ||
argument: { | ||
type: "Literal", | ||
value: 1 | ||
} | ||
} | ||
}, | ||
operator: "*", | ||
right: { | ||
type: "Literal", | ||
value: 2 | ||
} | ||
} | ||
}] | ||
}, { | ||
ecmaVersion: 7 | ||
}); | ||
// ES7: Object Rest/Spread | ||
@@ -85,0 +211,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3512027
42
98456