Commit a609e5f6 authored by arv@chromium.org's avatar arv@chromium.org

Fix invalid syntax for JS setters in tests

ECMAScript setters require exactly one parameter.
We had a bunch of tests with zero parameters which
is not valid and should have been SyntaxErrors in
the first place.

BUG=383596

Review URL: https://codereview.chromium.org/339363002

git-svn-id: svn://svn.chromium.org/blink/trunk@176451 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c6c7e2a8
...@@ -1120,12 +1120,6 @@ crbug.com/381102 inspector/sources/debugger/debugger-step-into-custom-element-ca ...@@ -1120,12 +1120,6 @@ crbug.com/381102 inspector/sources/debugger/debugger-step-into-custom-element-ca
# Started being flaky in r175790. # Started being flaky in r175790.
crbug.com/361045 inspector/layers/tracing-layer-tree.html [ Pass Failure ] crbug.com/361045 inspector/layers/tracing-layer-tree.html [ Pass Failure ]
crbug.com/383596 fast/js/implicit-call-with-global-reentry.html [ Failure ]
crbug.com/383596 fast/js/reserved-words-as-property.html [ Failure ]
crbug.com/383596 inspector-protocol/runtime/runtime-getProperties.html [ Failure ]
crbug.com/383596 inspector/console/console-eval-scoped.html [ Timeout ]
crbug.com/383596 inspector/console/console-object-preview-accessors.html [ Timeout ]
crbug.com/384564 crypto/rsassa-pkcs1-v1_5-generate-key.html [ Pass Timeout ] crbug.com/384564 crypto/rsassa-pkcs1-v1_5-generate-key.html [ Pass Timeout ]
crbug.com/384950 fast/forms/submit-change-fragment.html [ Pass Timeout ] crbug.com/384950 fast/forms/submit-change-fragment.html [ Pass Timeout ]
crbug.com/384566 svg/custom/textPath-change-reference2.svg [ ImageOnlyFailure Pass ] crbug.com/384566 svg/custom/textPath-change-reference2.svg [ ImageOnlyFailure Pass ]
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,7 +8,7 @@ function testGlobalCode(test) { ...@@ -8,7 +8,7 @@ function testGlobalCode(test) {
} }
var testObject = { var testObject = {
get getterTest(){ testGlobalCode("var a, b, c, d; testVar = 'PASS';"); }, get getterTest(){ testGlobalCode("var a, b, c, d; testVar = 'PASS';"); },
set setterTest(){ testGlobalCode("var e, f, g, h; testVar = 'PASS';"); }, set setterTest(_){ testGlobalCode("var e, f, g, h; testVar = 'PASS';"); },
toString: function() { testGlobalCode("var i, j, k, l; testVar = 'PASS';"); return ''; }, toString: function() { testGlobalCode("var i, j, k, l; testVar = 'PASS';"); return ''; },
valueOf: function() { testGlobalCode("var m, n, o, p; testVar = 'PASS';"); return 0; }, valueOf: function() { testGlobalCode("var m, n, o, p; testVar = 'PASS';"); return 0; },
toStringTest: function() { "" + this; }, toStringTest: function() { "" + this; },
......
...@@ -56,7 +56,7 @@ function testWord(word, strictPrefix, expectedResult) { ...@@ -56,7 +56,7 @@ function testWord(word, strictPrefix, expectedResult) {
// These should be allowed for all words, even reserved ones. // These should be allowed for all words, even reserved ones.
testWordEvalAndFunction(strictPrefix + "({ \"" + word + "\": 42 }." + word + " === 42)", false); testWordEvalAndFunction(strictPrefix + "({ \"" + word + "\": 42 }." + word + " === 42)", false);
testWordEvalAndFunction(strictPrefix + "({ " + word + ": 42 }." + word + " === 42)", false); testWordEvalAndFunction(strictPrefix + "({ " + word + ": 42 }." + word + " === 42)", false);
testWordEvalAndFunction(strictPrefix + "({ get " + word + "(){}, set " + word + "(){}, parsedOkay: 42 }.parsedOkay === 42)", false); testWordEvalAndFunction(strictPrefix + "({ get " + word + "(){}, set " + word + "(_){}, parsedOkay: 42 }.parsedOkay === 42)", false);
} }
function testWordStrictAndNonStrict(word, condition) { function testWordStrictAndNonStrict(word, condition) {
......
...@@ -91,7 +91,7 @@ function test() ...@@ -91,7 +91,7 @@ function test()
function callbackStartNotOwn() function callbackStartNotOwn()
{ {
// Create an wrapper object with additional property. // Create an wrapper object with additional property.
var expression = "({ a: 2, set b() {}, get b() {return 5;}, __proto__: { a: 3, c: 4, get d() {return 6;} }})"; var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, __proto__: { a: 3, c: 4, get d() {return 6;} }})";
return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalNotOwn }; return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalNotOwn };
} }
...@@ -116,7 +116,7 @@ function test() ...@@ -116,7 +116,7 @@ function test()
function callbackStartAccessorsOnly() function callbackStartAccessorsOnly()
{ {
// Create an wrapper object with additional property. // Create an wrapper object with additional property.
var expression = "({ a: 2, set b() {}, get b() {return 5;}, c: 'c', set d(){} })"; var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, c: 'c', set d(_){} })";
return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalAccessorsOnly }; return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalAccessorsOnly };
} }
......
...@@ -41,7 +41,7 @@ Running: testConsoleEvalObject ...@@ -41,7 +41,7 @@ Running: testConsoleEvalObject
name : "setter" name : "setter"
set : { set : {
className : "Object" className : "Object"
description : "function setter() { }" description : "function setter(_) { }"
objectId : <string> objectId : <string>
type : "function" type : "function"
} }
......
...@@ -20,7 +20,7 @@ Object.prototype.undefValue = undefined; ...@@ -20,7 +20,7 @@ Object.prototype.undefValue = undefined;
var foo = "bar"; var foo = "bar";
var testObj = { var testObj = {
get getter() { }, get getter() { },
set setter() { }, set setter(_) { },
baz: "baz" baz: "baz"
}; };
......
...@@ -12,16 +12,16 @@ console.log(objectWithAccessors) ...@@ -12,16 +12,16 @@ console.log(objectWithAccessors)
console.table(tableObject) console.table(tableObject)
console.dir(objectWithAccessors) console.dir(objectWithAccessors)
[(...), (...), undefined × 2, Objectbar: 2foo: 1__proto__: Object, (...), Array[2]0: 11: 2length: 2__proto__: Array[0], (...), "value8", (...)] [(...), (...), undefined × 2, Objectbar: 2foo: 1__proto__: Object, (...), Array[2]0: 11: 2length: 2__proto__: Array[0], (...), "value8", (...)]
[(...), (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: "value8", 9: (...), splice: function]0: (...)get 0: function 0() { foo.bar = 1; }1: (...)get 1: function 1() { throw new Error("arrayLikeWithAccessors"); }set 3: function 3() {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: "value8"9: (...)get 9: function 9() { return NaN; }length: 10splice: function () {}__proto__: Object VM:2 [(...), (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: "value8", 9: (...), splice: function]0: (...)get 0: function 0() { foo.bar = 1; }1: (...)get 1: function 1() { throw new Error("arrayLikeWithAccessors"); }set 3: function 3(_) {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: "value8"9: (...)get 9: function 9() { return NaN; }length: 10splice: function () {}__proto__: Object VM:2
undefined undefined
Object {0: (...), 1: (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: function, 9: (...)}0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object Object {0: (...), 1: (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: function, 9: (...)}0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object
Object {0: (...), 1: (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: function, 9: (...)}0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object VM:2 Object {0: (...), 1: (...), 3: (...), 4: Object, 5: (...), 6: Array[2], 7: (...), 8: function, 9: (...)}0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object VM:2
undefined undefined
HEADER (index) | 0 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | splice | HEADER (index) | 0 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | splice |
ROW (...) | (...) | (...) | Object | (...) | Array[2] | (...) | "value8" | (...) | function | ROW (...) | (...) | (...) | Object | (...) | Array[2] | (...) | "value8" | (...) | function |
ROW (...) | (...) | (...) | Object | (...) | Array[2] | (...) | function | (...) | ROW (...) | (...) | (...) | Object | (...) | Array[2] | (...) | function | (...) |
undefined undefined
Object0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object VM:2 Object0: (...)get 0: function 0() { baz.baz = 3; }1: (...)get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: (...)get 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: (...)get 7: function 7() { return [3, 4]; }8: function func8() {}9: (...)get 9: function 9() { return -Infinity; }__proto__: Object VM:2
undefined undefined
Accessor property buttons count: 55 Accessor property buttons count: 55
...@@ -34,15 +34,15 @@ console.log(objectWithAccessors) ...@@ -34,15 +34,15 @@ console.log(objectWithAccessors)
console.table(tableObject) console.table(tableObject)
console.dir(objectWithAccessors) console.dir(objectWithAccessors)
[<exception>, <exception>, undefined × 2, Objectbar: 2foo: 1__proto__: Object, Object, Array[2]0: 11: 2length: 2__proto__: Array[0], Array[2], "value8", NaN] [<exception>, <exception>, undefined × 2, Objectbar: 2foo: 1__proto__: Object, Object, Array[2]0: 11: 2length: 2__proto__: Array[0], Array[2], "value8", NaN]
[<exception>, <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: "value8", 9: NaN, splice: function]0: [Exception: ReferenceError: foo is not defined]get 0: function 0() { foo.bar = 1; }1: [Exception: Error: arrayLikeWithAccessors]get 1: function 1() { throw new Error("arrayLikeWithAccessors"); }set 3: function 3() {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: "value8"9: NaNget 9: function 9() { return NaN; }length: 10splice: function () {}__proto__: Object VM:2 [<exception>, <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: "value8", 9: NaN, splice: function]0: [Exception: ReferenceError: foo is not defined]get 0: function 0() { foo.bar = 1; }1: [Exception: Error: arrayLikeWithAccessors]get 1: function 1() { throw new Error("arrayLikeWithAccessors"); }set 3: function 3(_) {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: "value8"9: NaNget 9: function 9() { return NaN; }length: 10splice: function () {}__proto__: Object VM:2
undefined undefined
Object {0: <exception>, 1: <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: function, 9: -Infinity}0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object Object {0: <exception>, 1: <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: function, 9: -Infinity}0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object
Object {0: <exception>, 1: <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: function, 9: -Infinity}0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object VM:2 Object {0: <exception>, 1: <exception>, 3: undefined, 4: Object, 5: Object, 6: Array[2], 7: Array[2], 8: function, 9: -Infinity}0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object VM:2
undefined undefined
HEADER (index) | 0 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | splice | HEADER (index) | 0 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | splice |
ROW <exception> | <exception> | undefined | Object | Object | Array[2] | Array[2] | "value8" | NaN | function | ROW <exception> | <exception> | undefined | Object | Object | Array[2] | Array[2] | "value8" | NaN | function |
ROW <exception> | <exception> | undefined | Object | Object | Array[2] | Array[2] | function | -Infinity | ROW <exception> | <exception> | undefined | Object | Object | Array[2] | Array[2] | function | -Infinity |
undefined undefined
Object0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3() {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object VM:2 Object0: [Exception: ReferenceError: baz is not defined]get 0: function 0() { baz.baz = 3; }1: [Exception: Error: objectWithAccessors]get 1: function 1() { throw new Error("objectWithAccessors"); }set 3: function 3(_) {}4: Object5: Objectget 5: function 5() { return {afoo: 3, abar: 4}; }6: Array[2]7: Array[2]get 7: function 7() { return [3, 4]; }8: function func8() {}9: -Infinityget 9: function 9() { return -Infinity; }__proto__: Object VM:2
undefined undefined
...@@ -9,7 +9,7 @@ var arrayLikeWithAccessors = { ...@@ -9,7 +9,7 @@ var arrayLikeWithAccessors = {
length: 10, length: 10,
get 0() { foo.bar = 1; }, get 0() { foo.bar = 1; },
get 1() { throw new Error("arrayLikeWithAccessors"); }, get 1() { throw new Error("arrayLikeWithAccessors"); },
set 3() {}, set 3(_) {},
4: {foo: 1, bar: 2}, 4: {foo: 1, bar: 2},
get 5() { return {afoo: 3, abar: 4}; }, get 5() { return {afoo: 3, abar: 4}; },
6: [1, 2], 6: [1, 2],
...@@ -21,7 +21,7 @@ var arrayLikeWithAccessors = { ...@@ -21,7 +21,7 @@ var arrayLikeWithAccessors = {
var objectWithAccessors = { var objectWithAccessors = {
get 0() { baz.baz = 3; }, get 0() { baz.baz = 3; },
get 1() { throw new Error("objectWithAccessors"); }, get 1() { throw new Error("objectWithAccessors"); },
set 3() {}, set 3(_) {},
4: {foo: 1, bar: 2}, 4: {foo: 1, bar: 2},
get 5() { return {afoo: 3, abar: 4}; }, get 5() { return {afoo: 3, abar: 4}; },
6: [1, 2], 6: [1, 2],
......
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