Commit c5d75a38 authored by neis's avatar neis Committed by Commit bot

[test] Add more maybe-assigned tests for parameters.

R=marja@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2580833005
Cr-Commit-Position: refs/heads/master@{#42006}
parent 380a0207
...@@ -3453,6 +3453,8 @@ TEST(MaybeAssignedParameters) { ...@@ -3453,6 +3453,8 @@ TEST(MaybeAssignedParameters) {
{false, {false,
"function f(arg, arguments=[]) {g(arg); arguments[0] = 42; g(arg)}"}, "function f(arg, arguments=[]) {g(arg); arguments[0] = 42; g(arg)}"},
{false, "function f(...arg) {g(arg); arguments[0] = 42; g(arg)}"}, {false, "function f(...arg) {g(arg); arguments[0] = 42; g(arg)}"},
{false,
"function f(arg) {g(arg); g(function() {arguments[0] = 42}); g(arg)}"},
// strict arguments object // strict arguments object
{false, "function f(arg, x=1) {g(arg); arguments[0] = 42; g(arg)}"}, {false, "function f(arg, x=1) {g(arg); arguments[0] = 42; g(arg)}"},
...@@ -3471,9 +3473,11 @@ TEST(MaybeAssignedParameters) { ...@@ -3471,9 +3473,11 @@ TEST(MaybeAssignedParameters) {
{true, "function f(arg=1) {g(arg); arg = 42; g(arg)}"}, {true, "function f(arg=1) {g(arg); arg = 42; g(arg)}"},
{true, "function f(arg) {'use strict'; g(arg); arg = 42; g(arg)}"}, {true, "function f(arg) {'use strict'; g(arg); arg = 42; g(arg)}"},
{true, "function f(arg, {a=(g(arg), arg=42)}) {g(arg)}"}, {true, "function f(arg, {a=(g(arg), arg=42)}) {g(arg)}"},
{true, "function f(arg) {g(arg); g(function() {arg = 42}); g(arg)}"},
{true,
"function f(arg) {g(arg); g(function() {eval('arg = 42')}); g(arg)}"},
{true, "function f(arg) {g(arg); g(() => arg = 42); g(arg)}"}, {true, "function f(arg) {g(arg); g(() => arg = 42); g(arg)}"},
{true, "function f(arg) {g(arg); g(() => eval('arg = 42')); g(arg)}"}, {true, "function f(arg) {g(arg); g(() => eval('arg = 42')); g(arg)}"},
{true, "function f(arg) {g(arg); g(() => arguments[0] = 42); g(arg)}"},
{true, "function f(...arg) {g(arg); eval('arg = 42'); g(arg)}"}, {true, "function f(...arg) {g(arg); eval('arg = 42'); g(arg)}"},
// sloppy arguments object // sloppy arguments object
...@@ -3483,6 +3487,7 @@ TEST(MaybeAssignedParameters) { ...@@ -3483,6 +3487,7 @@ TEST(MaybeAssignedParameters) {
"function f(arg) {((args) => {arguments[0] = 42})(arguments); " "function f(arg) {((args) => {arguments[0] = 42})(arguments); "
"g(arg)}"}, "g(arg)}"},
{true, "function f(arg) {g(arg); eval('arguments[0] = 42'); g(arg)}"}, {true, "function f(arg) {g(arg); eval('arguments[0] = 42'); g(arg)}"},
{true, "function f(arg) {g(arg); g(() => arguments[0] = 42); g(arg)}"},
}; };
const char* suffix = "; f"; const char* suffix = "; f";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment