mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Merge pull request #240 from anba/es2015-compat-updates
Update remaining tests for ES2015 compatibility (rev38)
This commit is contained in:
commit
87fd4e5699
@ -14,7 +14,7 @@ includes: [runTestCase.js]
|
|||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var b = Array.isArray(Array.prototype);
|
var b = Array.isArray(Array.prototype);
|
||||||
if (b === false) {
|
if (b === true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: The length property of Array.prototype is undefined
|
info: The length property of Array.prototype is 0
|
||||||
es5id: 15.4.3.1_A5
|
es5id: 15.4.3.1_A5
|
||||||
description: Array.prototype.length === undefined
|
description: Array.prototype.length === 0
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (Array.prototype.length !== undefined) {
|
if (Array.prototype.length !== 0) {
|
||||||
$ERROR('#1.1: Array.prototype.length === undefined. Actual: ' + (Array.prototype.length));
|
$ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length));
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4_A1.1_T2
|
es5id: 15.4.4_A1.1_T2
|
||||||
description: >
|
description: >
|
||||||
The Array prototype object is itself not an array; its [[Class]]
|
The Array prototype object is itself an array; its [[Class]]
|
||||||
is "Object",
|
is "Array",
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (Object.prototype.toString.call(Array.prototype) !== "[object Object]") {
|
if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") {
|
||||||
$ERROR('The Array prototype object is itself not an array; its' +
|
$ERROR('The Array prototype object is itself an array; its' +
|
||||||
'[[Class]] is "Object".');
|
'[[Class]] is "Array".');
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: The [[Class]] property of the Array prototype object is set to "Object"
|
info: The [[Class]] property of the Array prototype object is set to "Array"
|
||||||
es5id: 15.4.4_A1.2_T1
|
es5id: 15.4.4_A1.2_T1
|
||||||
description: Checking use Object.prototype.toString
|
description: Checking use Object.prototype.toString
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
Array.prototype.getClass = Object.prototype.toString;
|
Array.prototype.getClass = Object.prototype.toString;
|
||||||
if (Array.prototype.getClass() !== "[object " + "Object" + "]") {
|
if (Array.prototype.getClass() !== "[object " + "Array" + "]") {
|
||||||
$ERROR('#1: Array.prototype.getClass = Object.prototype.toString; Array.prototype is Object object. Actual: ' + (Array.prototype.getClass()));
|
$ERROR('#1: Array.prototype.getClass = Object.prototype.toString; Array.prototype is Array object. Actual: ' + (Array.prototype.getClass()));
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: Array prototype object does not have a length property
|
info: Array prototype object has a length property
|
||||||
es5id: 15.4.4_A1.3_T1
|
es5id: 15.4.4_A1.3_T1
|
||||||
description: Array.prototype.length === undefined
|
description: Array.prototype.length === 0
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (Array.prototype.length !== undefined) {
|
if (Array.prototype.length !== 0) {
|
||||||
$ERROR('#1.1: Array.prototype.length === undefined. Actual: ' + (Array.prototype.length));
|
$ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length));
|
||||||
}
|
}
|
||||||
|
@ -34,19 +34,16 @@ if (obj["0"] !== -1) {
|
|||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
obj.length = Number.POSITIVE_INFINITY;
|
obj.length = Number.POSITIVE_INFINITY;
|
||||||
var push = obj.push(-4);
|
assert.throws(TypeError, function() { obj.push(-4); });
|
||||||
if (push !== 9007199254740992) {
|
|
||||||
$ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4) === 9007199254740992. Actual: ' + (push));
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
if (obj.length !== 9007199254740992) {
|
if (obj.length !== Number.POSITIVE_INFINITY) {
|
||||||
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === 9007199254740992. Actual: ' + (obj.length));
|
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === Number.POSITIVE_INFINITY. Actual: ' + (obj.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
if (obj[9007199254740991] !== -4) {
|
if (obj[9007199254740991] !== undefined) {
|
||||||
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj[9007199254740991] === -4. Actual: ' + (obj["0"]));
|
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj[9007199254740991] === undefined. Actual: ' + (obj["9007199254740991"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
es5id: 15.3.4.5-15-2
|
es5id: 15.3.4.5-15-2
|
||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' is a data valued own property
|
Function.prototype.bind, 'length' is a data valued own property
|
||||||
with default attributes (false)
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ function testcase() {
|
|||||||
if (desc.value === 0 &&
|
if (desc.value === 0 &&
|
||||||
desc.enumerable === false &&
|
desc.enumerable === false &&
|
||||||
desc.writable === false &&
|
desc.writable === false &&
|
||||||
desc.configurable == false) {
|
desc.configurable == true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,20 +7,14 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.10.4.1-1
|
es5id: 15.10.4.1-1
|
||||||
description: >
|
description: >
|
||||||
RegExp - the thrown error is TypeError instead of RegExpError when
|
RegExp - no TypeError is thrown when pattern is an object whose
|
||||||
pattern is an object whose [[Class]] property is 'RegExp' and
|
[[Class]] property is 'RegExp' and flags is not undefined
|
||||||
flags is not undefined
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var regObj = new RegExp();
|
var regObj = new RegExp();
|
||||||
try {
|
var regExpObj = new RegExp(regObj, "g");
|
||||||
var regExpObj = new RegExp(regObj, true);
|
return regExpObj.global;
|
||||||
|
}
|
||||||
return false;
|
|
||||||
} catch (e) {
|
|
||||||
return e instanceof TypeError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -13,9 +13,9 @@ description: >
|
|||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
try {
|
try {
|
||||||
$ERROR('#1.1: RegExp(new RegExp("\\d"), "1")) throw TypeError. Actual: ' + (RegExp(new RegExp("\d"), "1")));
|
$ERROR('#1.1: RegExp(new RegExp("\\d"), "1")) throw SyntaxError. Actual: ' + (RegExp(new RegExp("\d"), "1")));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if ((e instanceof TypeError) !== true) {
|
if ((e instanceof SyntaxError) !== true) {
|
||||||
$ERROR('#1.2: RegExp(new RegExp("\\d"), "1")) throw TypeError. Actual: ' + (e));
|
$ERROR('#1.2: RegExp(new RegExp("\\d"), "1")) throw SyntaxError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ var x = 1;
|
|||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
try {
|
try {
|
||||||
$ERROR('#1.1: var x = 1; RegExp(/[a-b]?/, x) throw TypeError. Actual: ' + (RegExp(/[a-b]?/, x)));
|
$ERROR('#1.1: var x = 1; RegExp(/[a-b]?/, x) throw SyntaxError. Actual: ' + (RegExp(/[a-b]?/, x)));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if ((e instanceof TypeError) !== true) {
|
if ((e instanceof SyntaxError) !== true) {
|
||||||
$ERROR('#1.2: var x = 1; RegExp(/[a-b]?/, x) throw TypeError. Actual: ' + (e));
|
$ERROR('#1.2: var x = 1; RegExp(/[a-b]?/, x) throw SyntaxError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,19 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
If pattern is an object R whose [[Class]] property is "RegExp" and flags
|
pattern is an object R whose [[Class]] property is "RegExp" and flags
|
||||||
is not undefined, then throw a TypeError exception
|
is not undefined
|
||||||
es5id: 15.10.4.1_A2_T1
|
es5id: 15.10.4.1_A2_T1
|
||||||
description: >
|
description: >
|
||||||
Checking if execution of "new RegExp(pattern, "i")", where the
|
Checking if execution of "new RegExp(pattern, "i")", where the
|
||||||
pattern is "/\u0042/i", fails
|
pattern is "/\u0042/i", does not fail
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
try {
|
var regExpObj = new RegExp(/\u0042/i, "i");
|
||||||
$ERROR('#1.1: new RegExp(/\\u0042/i, "i") throw TypeError. Actual: ' + (new RegExp(/\u0042/i, "i")));
|
assert(regExpObj.ignoreCase);
|
||||||
} catch (e) {
|
|
||||||
if ((e instanceof TypeError) !== true) {
|
|
||||||
$ERROR('#1.2: new RegExp(/\\u0042/i, "i") throw TypeError. Actual: ' + (e));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
If pattern is an object R whose [[Class]] property is "RegExp" and flags
|
pattern is an object R whose [[Class]] property is "RegExp" and flags
|
||||||
is not undefined, then throw a TypeError exception
|
is not undefined. If ToString(pattern) is not a valid flags arguments,
|
||||||
|
then throw a SyntaxError exception
|
||||||
es5id: 15.10.4.1_A2_T2
|
es5id: 15.10.4.1_A2_T2
|
||||||
description: >
|
description: >
|
||||||
Checking if execution of "new RegExp(pattern, {})", where the
|
Checking if execution of "new RegExp(pattern, {})", where the
|
||||||
@ -13,9 +14,9 @@ description: >
|
|||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
try {
|
try {
|
||||||
$ERROR('#1.1: new RegExp(/1?1/mig, {}) throw TypeError. Actual: ' + (new RegExp(/1?1/mig, {})));
|
$ERROR('#1.1: new RegExp(/1?1/mig, {}) throw SyntaxError. Actual: ' + (new RegExp(/1?1/mig, {})));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if ((e instanceof TypeError) !== true) {
|
if ((e instanceof SyntaxError) !== true) {
|
||||||
$ERROR('#1.2: new RegExp(/1?1/mig, {}) throw TypeError. Actual: ' + (e));
|
$ERROR('#1.2: new RegExp(/1?1/mig, {}) throw SyntaxError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
RegExp.prototype.exec behavior depends on global property.
|
RegExp.prototype.exec behavior depends on global property.
|
||||||
Let global is true and let I = If ToInteger(lastIndex).
|
Let global is true and let I = If ToLength(lastIndex).
|
||||||
Then if I<0 orI>length then set lastIndex to 0 and return null
|
Then if I>length then set lastIndex to 0 and return null
|
||||||
es5id: 15.10.6.2_A5_T3
|
es5id: 15.10.6.2_A5_T3
|
||||||
description: "Set lastIndex to -1 and call /(?:ab|cd)\\d?/g.exec(\"aacd22 \")"
|
description: "Set lastIndex to -1 and call /(?:ab|cd)\\d?/g.exec(\"aacd22 \")"
|
||||||
---*/
|
---*/
|
||||||
@ -15,24 +15,24 @@ __re.lastIndex=-1;
|
|||||||
__executed = __re.test("aacd22 ");
|
__executed = __re.test("aacd22 ");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (__executed) {
|
if (!__executed) {
|
||||||
$ERROR('#1: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __executed === true');
|
$ERROR('#1: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __executed === true');
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
if (__re.lastIndex !== 0) {
|
if (__re.lastIndex !== 5) {
|
||||||
$ERROR('#2: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex === 0. Actual: ' + (__re.lastIndex));
|
$ERROR('#2: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex === 5. Actual: ' + (__re.lastIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
__re.lastIndex=-100;
|
__re.lastIndex=-100;
|
||||||
__executed = __re.test("aacd22 ");
|
__executed = __re.test("aacd22 ");
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
if (__executed) {
|
if (!__executed) {
|
||||||
$ERROR('#3: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __executed === true');
|
$ERROR('#3: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __executed === true');
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
if (__re.lastIndex !== 0) {
|
if (__re.lastIndex !== 5) {
|
||||||
$ERROR('#4: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __re.lastIndex === 0. Actual: ' + (__re.lastIndex));
|
$ERROR('#4: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __re.lastIndex === 5. Actual: ' + (__re.lastIndex));
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,8 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 11.1.5-2gs
|
es5id: 11.1.5-2gs
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - SyntaxError is thrown when eval code contains an
|
Duplicate definitions of data properties are allowed in ObjectLiterals.
|
||||||
ObjectLiteral with more than one definition of any data property
|
|
||||||
negative: SyntaxError
|
|
||||||
flags: [onlyStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
var obj = { _11_1_5_2_gs: 10, _11_1_5_2_gs: 20 };
|
||||||
throw NotEarlyError;
|
assert.sameValue(obj._11_1_5_2_gs, 20);
|
||||||
var obj = { _11_1_5_2_gs: 10, _11_1_5_2_gs: 10 };
|
|
||||||
|
@ -5,30 +5,14 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
a. This production is contained in strict code and IsDataDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true
|
|
||||||
es5id: 11.1.5-4-4-a-1-s
|
es5id: 11.1.5-4-4-a-1-s
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError for duplicate date property name in
|
Object literal - No SyntaxError for duplicate data property names
|
||||||
strict mode
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
eval("({foo:0,foo:1});");
|
||||||
try
|
return true;
|
||||||
{
|
}
|
||||||
eval("'use strict'; ({foo:0,foo:1});");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return (e instanceof SyntaxError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.
|
|
||||||
es5id: 11.1.5_4-4-b-1
|
es5id: 11.1.5_4-4-b-1
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError if a data property definition is
|
Object literal - No SyntaxError if a data property definition is
|
||||||
followed by get accessor definition with the same name
|
followed by get accessor definition with the same name
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({foo : 1, get foo(){}});");
|
eval("({foo : 1, get foo(){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.
|
|
||||||
es5id: 11.1.5_4-4-b-2
|
es5id: 11.1.5_4-4-b-2
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError if a data property definition is
|
Object literal - No SyntaxError if a data property definition is
|
||||||
followed by set accessor definition with the same name
|
followed by set accessor definition with the same name
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({foo : 1, set foo(x){}});");
|
eval("({foo : 1, set foo(x){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
|
|
||||||
es5id: 11.1.5_4-4-c-1
|
es5id: 11.1.5_4-4-c-1
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError if a get accessor property definition
|
Object literal - No SyntaxError if a get accessor property definition
|
||||||
is followed by a data property definition with the same name
|
is followed by a data property definition with the same name
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({get foo(){}, foo : 1});");
|
eval("({get foo(){}, foo : 1});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
|
|
||||||
es5id: 11.1.5_4-4-c-2
|
es5id: 11.1.5_4-4-c-2
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError if a set accessor property definition
|
Object literal - No SyntaxError if a set accessor property definition
|
||||||
is followed by a data property definition with the same name
|
is followed by a data property definition with the same name
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({set foo(x){}, foo : 1});");
|
eval("({set foo(x){}, foo : 1});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,26 +5,13 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields
|
|
||||||
es5id: 11.1.5_4-4-d-1
|
es5id: 11.1.5_4-4-d-1
|
||||||
description: Object literal - SyntaxError for duplicate property name (get,get)
|
description: Object literal - No SyntaxError for duplicate property name (get,get)
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({get foo(){}, get foo(){}});");
|
eval("({get foo(){}, get foo(){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,26 +5,13 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields
|
|
||||||
es5id: 11.1.5_4-4-d-2
|
es5id: 11.1.5_4-4-d-2
|
||||||
description: Object literal - SyntaxError for duplicate property name (set,set)
|
description: Object literal - No SyntaxError for duplicate property name (set,set)
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({set foo(arg){}, set foo(arg1){}});");
|
eval("({set foo(arg){}, set foo(arg1){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields
|
|
||||||
es5id: 11.1.5_4-4-d-3
|
es5id: 11.1.5_4-4-d-3
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError for duplicate property name
|
Object literal - No SyntaxError for duplicate property name
|
||||||
(get,set,get)
|
(get,set,get)
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({get foo(){}, set foo(arg){}, get foo(){}});");
|
eval("({get foo(){}, set foo(arg){}, get foo(){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -5,28 +5,15 @@
|
|||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
|
||||||
Refer 11.1.5;
|
|
||||||
The production
|
|
||||||
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
||||||
4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
|
||||||
d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields
|
|
||||||
es5id: 11.1.5_4-4-d-4
|
es5id: 11.1.5_4-4-d-4
|
||||||
description: >
|
description: >
|
||||||
Object literal - SyntaxError for duplicate property name
|
Object literal - No SyntaxError for duplicate property name
|
||||||
(set,get,set)
|
(set,get,set)
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try
|
|
||||||
{
|
|
||||||
eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});");
|
eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
return e instanceof SyntaxError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user