Modified: trunk/LayoutTests/js/parser-syntax-check-expected.txt (203262 => 203263)
--- trunk/LayoutTests/js/parser-syntax-check-expected.txt 2016-07-15 02:07:45 UTC (rev 203262)
+++ trunk/LayoutTests/js/parser-syntax-check-expected.txt 2016-07-15 02:11:42 UTC (rev 203263)
@@ -1156,6 +1156,99 @@
PASS Invalid: "function f() { 'use strict'; function foo(...yield) { } }"
PASS Invalid: "function foo(...if) { }"
PASS Invalid: "function f() { function foo(...if) { } }"
+non-simple parameter list
+PASS Invalid: "function foo(...restParam) { 'use strict'; }"
+PASS Invalid: "function f() { function foo(...restParam) { 'use strict'; } }"
+PASS Invalid: "function foo(...restParam) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo(...restParam) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo({x}) { 'use strict'; }"
+PASS Invalid: "function f() { function foo({x}) { 'use strict'; } }"
+PASS Invalid: "function foo({x}) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo({x}) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo(a = 20) { 'use strict'; }"
+PASS Invalid: "function f() { function foo(a = 20) { 'use strict'; } }"
+PASS Invalid: "function foo(a = 20) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo(a = 20) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo({a} = 20) { 'use strict'; }"
+PASS Invalid: "function f() { function foo({a} = 20) { 'use strict'; } }"
+PASS Invalid: "function foo({a} = 20) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo({a} = 20) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo([a]) { 'use strict'; }"
+PASS Invalid: "function f() { function foo([a]) { 'use strict'; } }"
+PASS Invalid: "function foo([a]) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo([a]) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo(foo, bar, a = 25) { 'use strict'; }"
+PASS Invalid: "function f() { function foo(foo, bar, a = 25) { 'use strict'; } }"
+PASS Invalid: "function foo(foo, bar, a = 25) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo(foo, bar, a = 25) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo(foo, bar, baz, ...rest) { 'use strict'; }"
+PASS Invalid: "function f() { function foo(foo, bar, baz, ...rest) { 'use strict'; } }"
+PASS Invalid: "function foo(foo, bar, baz, ...rest) { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { function foo(foo, bar, baz, ...rest) { 'a'; 'use strict'; } }"
+PASS Invalid: "function foo(a = function() { }) { 'use strict'; a(); }"
+PASS Invalid: "function f() { function foo(a = function() { }) { 'use strict'; a(); } }"
+PASS Invalid: "function foo(a = function() { }) { 'a'; 'use strict'; a(); }"
+PASS Invalid: "function f() { function foo(a = function() { }) { 'a'; 'use strict'; a(); } }"
+PASS Invalid: "let foo = (...restParam) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = (...restParam) => { 'use strict'; } }"
+PASS Invalid: "let foo = (...restParam) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = (...restParam) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = ({x}) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = ({x}) => { 'use strict'; } }"
+PASS Invalid: "let foo = ({x}) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = ({x}) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = (a = 20) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = (a = 20) => { 'use strict'; } }"
+PASS Invalid: "let foo = (a = 20) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = (a = 20) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = ({a} = 20) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = ({a} = 20) => { 'use strict'; } }"
+PASS Invalid: "let foo = ({a} = 20) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = ({a} = 20) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = ([a]) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = ([a]) => { 'use strict'; } }"
+PASS Invalid: "let foo = ([a]) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = ([a]) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = (foo, bar, a = 25) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = (foo, bar, a = 25) => { 'use strict'; } }"
+PASS Invalid: "let foo = (foo, bar, a = 25) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = (foo, bar, a = 25) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = (foo, bar, baz, ...rest) => { 'use strict'; }"
+PASS Invalid: "function f() { let foo = (foo, bar, baz, ...rest) => { 'use strict'; } }"
+PASS Invalid: "let foo = (foo, bar, baz, ...rest) => { 'a'; 'use strict'; }"
+PASS Invalid: "function f() { let foo = (foo, bar, baz, ...rest) => { 'a'; 'use strict'; } }"
+PASS Invalid: "let foo = (a = function() { }) => { 'use strict'; a(); }"
+PASS Invalid: "function f() { let foo = (a = function() { }) => { 'use strict'; a(); } }"
+PASS Invalid: "let foo = (a = function() { }) => { 'a'; 'use strict'; a(); }"
+PASS Invalid: "function f() { let foo = (a = function() { }) => { 'a'; 'use strict'; a(); } }"
+PASS Valid: "function outer() { 'use strict'; function foo(...restParam) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(...restParam) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a,b,c,...restParam) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a,b,c,...restParam) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a = 20,b,c,...restParam) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a = 20,b,c,...restParam) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a = 20,{b},c,...restParam) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a = 20,{b},c,...restParam) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a = 20,{b},[c] = 5,...restParam) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a = 20,{b},[c] = 5,...restParam) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a = 20) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a = 20) { } } }"
+PASS Valid: "function outer() { 'use strict'; function foo(a,b,c,{d} = 20) { } }"
+PASS Valid: "function f() { function outer() { 'use strict'; function foo(a,b,c,{d} = 20) { } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(...restParam) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(...restParam) { 'use strict'; } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a,b,c,...restParam) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a,b,c,...restParam) { 'use strict'; } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a = 20,b,c,...restParam) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a = 20,b,c,...restParam) { 'use strict'; } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a = 20,{b},c,...restParam) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a = 20,{b},c,...restParam) { 'use strict'; } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a = 20,{b},[c] = 5,...restParam) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a = 20,{b},[c] = 5,...restParam) { 'use strict'; } } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a = 20) { 'use strict';} }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a = 20) { 'use strict';} } }"
+PASS Invalid: "function outer() { 'use strict'; function foo(a,b,c,{d} = 20) { 'use strict'; } }"
+PASS Invalid: "function f() { function outer() { 'use strict'; function foo(a,b,c,{d} = 20) { 'use strict'; } } }"
Arrow function
PASS Valid: "var x = (x) => x;"
PASS Valid: "function f() { var x = (x) => x; }"
Modified: trunk/Source/_javascript_Core/tests/stress/reflect-set.js (203262 => 203263)
--- trunk/Source/_javascript_Core/tests/stress/reflect-set.js 2016-07-15 02:07:45 UTC (rev 203262)
+++ trunk/Source/_javascript_Core/tests/stress/reflect-set.js 2016-07-15 02:11:42 UTC (rev 203263)
@@ -571,126 +571,128 @@
[ Int32Array, 4 ],
[ Float32Array, 4 ],
[ Float64Array, 8 ],
-].forEach(function typedArrayCase([ TypedArray, bytesPerElement ]) {
+].forEach((function() {
'use strict';
- var object = new TypedArray(64);
- shouldBe(Reflect.get(object, 'hello'), undefined);
- shouldBe(Reflect.set(object, 'hello', 42), true);
- shouldBe(Reflect.get(object, 'hello'), 42);
- shouldBe(Reflect.get(object, 0), 0);
- shouldBe(Reflect.set(object, 0, 42), true);
- shouldBe(Reflect.get(object, 0), 42);
- shouldBe(Reflect.get(object, symbol), undefined);
- shouldBe(Reflect.set(object, symbol, 42), true);
- shouldBe(Reflect.get(object, symbol), 42);
- object[1000000] = 'Hello';
- shouldBe(Reflect.set(object, 0, 50), true);
- shouldBe(Reflect.get(object, 0), 50);
+ return function typedArrayCase([ TypedArray, bytesPerElement ]) {
+ var object = new TypedArray(64);
+ shouldBe(Reflect.get(object, 'hello'), undefined);
+ shouldBe(Reflect.set(object, 'hello', 42), true);
+ shouldBe(Reflect.get(object, 'hello'), 42);
+ shouldBe(Reflect.get(object, 0), 0);
+ shouldBe(Reflect.set(object, 0, 42), true);
+ shouldBe(Reflect.get(object, 0), 42);
+ shouldBe(Reflect.get(object, symbol), undefined);
+ shouldBe(Reflect.set(object, symbol, 42), true);
+ shouldBe(Reflect.get(object, symbol), 42);
+ object[1000000] = 'Hello';
+ shouldBe(Reflect.set(object, 0, 50), true);
+ shouldBe(Reflect.get(object, 0), 50);
- var object = new TypedArray(64);
- shouldBe(Reflect.defineProperty(object, 'hello', {
- value: 'Cocoa',
- writable: false
- }), true);
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.set(object, 'hello', 42), false);
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.defineProperty(object, 0, {
- value: 'Cocoa',
- writable: false
- }), false);
- shouldBe(Reflect.get(object, 0), 0);
- shouldBe(Reflect.set(object, 0, 42), true);
- shouldBe(Reflect.get(object, 0), 42);
- shouldBe(object.length, 64);
- shouldBe(Reflect.defineProperty(object, symbol, {
- value: 'Cocoa',
- writable: false
- }), true);
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
- shouldBe(Reflect.set(object, symbol, 42), false);
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ var object = new TypedArray(64);
+ shouldBe(Reflect.defineProperty(object, 'hello', {
+ value: 'Cocoa',
+ writable: false
+ }), true);
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.set(object, 'hello', 42), false);
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.defineProperty(object, 0, {
+ value: 'Cocoa',
+ writable: false
+ }), false);
+ shouldBe(Reflect.get(object, 0), 0);
+ shouldBe(Reflect.set(object, 0, 42), true);
+ shouldBe(Reflect.get(object, 0), 42);
+ shouldBe(object.length, 64);
+ shouldBe(Reflect.defineProperty(object, symbol, {
+ value: 'Cocoa',
+ writable: false
+ }), true);
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ shouldBe(Reflect.set(object, symbol, 42), false);
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
- var object = new TypedArray(64);
- shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
- shouldBe(Reflect.set(object, 'byteLength', 'Cappuccino'), false);
- shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
+ var object = new TypedArray(64);
+ shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
+ shouldBe(Reflect.set(object, 'byteLength', 'Cappuccino'), false);
+ shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
- var object = new TypedArray(64);
- shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
- shouldBe(Reflect.set(object, 'byteLength', 2000), false);
- shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
+ var object = new TypedArray(64);
+ shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
+ shouldBe(Reflect.set(object, 'byteLength', 2000), false);
+ shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64);
- var object = new TypedArray(64);
- shouldBe(Reflect.defineProperty(object, 'hello', {
- get() {
- return 'Cocoa';
- },
- set() {
- }
- }), true);
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists.
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.defineProperty(object, 0, {
- get() {
- return 'Cocoa';
- },
- set() {
- }
- }), false);
- shouldBe(Reflect.get(object, 0), 0);
- shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists.
- shouldBe(Reflect.get(object, 0), 42);
- shouldBe(Reflect.defineProperty(object, symbol, {
- get() {
- return 'Cocoa';
- },
- set() {
- }
- }), true);
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
- shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists.
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ var object = new TypedArray(64);
+ shouldBe(Reflect.defineProperty(object, 'hello', {
+ get() {
+ return 'Cocoa';
+ },
+ set() {
+ }
+ }), true);
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists.
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.defineProperty(object, 0, {
+ get() {
+ return 'Cocoa';
+ },
+ set() {
+ }
+ }), false);
+ shouldBe(Reflect.get(object, 0), 0);
+ shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists.
+ shouldBe(Reflect.get(object, 0), 42);
+ shouldBe(Reflect.defineProperty(object, symbol, {
+ get() {
+ return 'Cocoa';
+ },
+ set() {
+ }
+ }), true);
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists.
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
- var object = new TypedArray(64);
- shouldBe(Reflect.defineProperty(object, 'hello', {
- get() {
- return 'Cocoa';
- }
- }), true);
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.set(object, 'hello', 42), false);
- shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
- shouldBe(Reflect.defineProperty(object, 0, {
- get() {
- return 'Cocoa';
- }
- }), false);
- shouldBe(Reflect.get(object, 0), 0);
- shouldBe(Reflect.set(object, 0, 42), true);
- shouldBe(Reflect.get(object, 0), 42);
- shouldBe(Reflect.defineProperty(object, symbol, {
- get() {
- return 'Cocoa';
- }
- }), true);
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
- shouldBe(Reflect.set(object, symbol, 42), false);
- shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ var object = new TypedArray(64);
+ shouldBe(Reflect.defineProperty(object, 'hello', {
+ get() {
+ return 'Cocoa';
+ }
+ }), true);
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.set(object, 'hello', 42), false);
+ shouldBe(Reflect.get(object, 'hello'), 'Cocoa');
+ shouldBe(Reflect.defineProperty(object, 0, {
+ get() {
+ return 'Cocoa';
+ }
+ }), false);
+ shouldBe(Reflect.get(object, 0), 0);
+ shouldBe(Reflect.set(object, 0, 42), true);
+ shouldBe(Reflect.get(object, 0), 42);
+ shouldBe(Reflect.defineProperty(object, symbol, {
+ get() {
+ return 'Cocoa';
+ }
+ }), true);
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
+ shouldBe(Reflect.set(object, symbol, 42), false);
+ shouldBe(Reflect.get(object, symbol), 'Cocoa');
- receiverTest(new TypedArray(64), new TypedArray(64));
- receiverTest(new TypedArray(64), {});
- receiverTest({}, new TypedArray(64));
+ receiverTest(new TypedArray(64), new TypedArray(64));
+ receiverTest(new TypedArray(64), {});
+ receiverTest({}, new TypedArray(64));
- var object = new TypedArray(64);
- var receiver = {};
- // The receiver is ignored when the property name is an indexed one.
- // shouldBe(Reflect.set(object, 0, 42, receiver), true);
- shouldBe(Reflect.set(object, 0, 42, receiver), true);
- shouldBe(Reflect.get(object, 0), 42);
- shouldBe(receiver.hasOwnProperty(0), false);
-});
+ var object = new TypedArray(64);
+ var receiver = {};
+ // The receiver is ignored when the property name is an indexed one.
+ // shouldBe(Reflect.set(object, 0, 42, receiver), true);
+ shouldBe(Reflect.set(object, 0, 42, receiver), true);
+ shouldBe(Reflect.get(object, 0), 42);
+ shouldBe(receiver.hasOwnProperty(0), false);
+ };
+})());
(function argumentCase() {