mirror of https://github.com/tc39/test262.git
Converted Sputnik's latest test case push to test262 format.
This commit is contained in:
parent
b8a44856a4
commit
e182868bad
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.1;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "abstract" token can be used as identifier;
|
||||
* @description: Checking if execution of "abstract=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
abstract = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.1",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.1.js",
|
||||
|
||||
assertion: "The \"abstract\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"abstract=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
abstract = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.12;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "final" token can be used as identifier;
|
||||
* @description: Checking if execution of "final=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
final = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.12",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.12.js",
|
||||
|
||||
assertion: "The \"final\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"final=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
final = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.13;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "float" token can be used as identifier;
|
||||
* @description: Checking if execution of "float=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
float = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.13",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.13.js",
|
||||
|
||||
assertion: "The \"float\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"float=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
float = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.14;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "goto" token can be used as identifier;
|
||||
* @description: Checking if execution of "goto=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
goto = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.14",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.14.js",
|
||||
|
||||
assertion: "The \"goto\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"goto=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
goto = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
implements = 1;
|
||||
|
||||
"use strict";
|
||||
implements = 1;
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.15;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "implements" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "implements=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.15ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.15ns.js",
|
||||
|
||||
assertion: "The \"implements\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"implements=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('implements = 1');
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.17;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "int" token can be used as identifier;
|
||||
* @description: Checking if execution of "int=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
int = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.17",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.17.js",
|
||||
|
||||
assertion: "The \"int\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"int=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
int = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
interface = 1;
|
||||
"use strict";
|
||||
interface = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.18;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "interface" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "interface = 1" succeeds in strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.18ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.18ns.js",
|
||||
|
||||
assertion: "The \"interface\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"interface = 1\" succeeds in strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('interface = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.19;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "long" token can be used as identifier;
|
||||
* @description: Checking if execution of "long=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
long = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.19",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.19.js",
|
||||
|
||||
assertion: "The \"long\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"long=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
long = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.2;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "boolean" token can be used as identifier;
|
||||
* @description: Checking if execution of "boolean=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
boolean = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.2",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.2.js",
|
||||
|
||||
assertion: "The \"boolean\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"boolean=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
boolean = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.20;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "native" token can be used as identifier;
|
||||
* @description: Checking if execution of "native=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
native = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.20",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.20.js",
|
||||
|
||||
assertion: "The \"native\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"native=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
native = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
package = 1;
|
||||
"use strict";
|
||||
package = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.21;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "package" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "package=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.21ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.21ns.js",
|
||||
|
||||
assertion: "The \"package\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"package=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('package = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
private = 1;
|
||||
"use strict";
|
||||
private = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.22;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "private" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "private=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.22ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.22ns.js",
|
||||
|
||||
assertion: "The \"private\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"private=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('private = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
protected = 1;
|
||||
"use strict";
|
||||
protected = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.23;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "protected" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "protected=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.23ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.23ns.js",
|
||||
|
||||
assertion: "The \"protected\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"protected=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('protected = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
public = 1;
|
||||
"use strict";
|
||||
public = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.24;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "public" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "public=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.24ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.24ns.js",
|
||||
|
||||
assertion: "The \"public\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"public=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('public = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.25;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "short" token can be used as identifier;
|
||||
* @description: Checking if execution of "short=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
short = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.25",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.25.js",
|
||||
|
||||
assertion: "The \"short\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"short=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
short = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
static = 1;
|
||||
"use strict";
|
||||
static = 1;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.26;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "static" token can be used as identifier in non-strict code;
|
||||
* @description: Checking if execution of "static=1" succeeds in non-strict code;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.26ns",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.26ns.js",
|
||||
|
||||
assertion: "The \"static\" token can be used as identifier in non-strict code",
|
||||
|
||||
description: "Checking if execution of \"static=1\" succeeds in non-strict code",
|
||||
|
||||
test: function testcase() {
|
||||
new Function('static = 1');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.28;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "synchronized" token can be used as identifier;
|
||||
* @description: Checking if execution of "synchronized=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
synchronized = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.28",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.28.js",
|
||||
|
||||
assertion: "The \"synchronized\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"synchronized=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
synchronized = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.29;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "throws" token can be used as identifier;
|
||||
* @description: Checking if execution of "throws=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
throws = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.29",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.29.js",
|
||||
|
||||
assertion: "The \"throws\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"throws=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
throws = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.3;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "byte" token can be used as identifier;
|
||||
* @description: Checking if execution of "byte=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
byte = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.3",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.3.js",
|
||||
|
||||
assertion: "The \"byte\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"byte=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
byte = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.30;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "transient" token can be used as identifier;
|
||||
* @description: Checking if execution of "transient=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
transient = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.30",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.30.js",
|
||||
|
||||
assertion: "The \"transient\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"transient=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
transient = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.31;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "volatile" token can be used as identifier;
|
||||
* @description: Checking if execution of "volatile=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
volatile = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.31",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.31.js",
|
||||
|
||||
assertion: "The \"volatile\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"volatile=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
volatile = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.4;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "char" token can be used as identifier;
|
||||
* @description: Checking if execution of "char=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
char = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.4",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.4.js",
|
||||
|
||||
assertion: "The \"char\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"char=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
char = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.5.3_A1.8;
|
||||
* @section: 7.5.3;
|
||||
* @assertion: The "double" token can be used as identifier;
|
||||
* @description: Checking if execution of "double=1" succeeds;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
double = 1;
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S7.5.3_A1.8",
|
||||
|
||||
path: "07_Lexical_Conventions\7.5_Tokens\7.5.3_Future_Reserved_Words\S7.5.3_A1.8.js",
|
||||
|
||||
assertion: "The \"double\" token can be used as identifier",
|
||||
|
||||
description: "Checking if execution of \"double=1\" succeeds",
|
||||
|
||||
test: function testcase() {
|
||||
double = 1;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T7;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u0067 (g);
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T7;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u0067 (g);
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,16 +21,11 @@ assertion: "RegularExpressionFlags :: IdentifierPart",
|
|||
description: "IdentifierPart :: \\u0067 (g)",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
|
||||
//Test262 Change
|
||||
//var regexp = /(?:)/\u0067;
|
||||
var regexp;
|
||||
eval('regexp = /(?:)/\\u0067;');
|
||||
|
||||
if (regexp.global !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u0067; regexp.global === true. Actual: ' + (regexp.global));
|
||||
}
|
||||
//CHECK#1
|
||||
var regexp = /(?:)/\u0067;
|
||||
if (regexp.global !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u0067; regexp.global === true. Actual: ' + (regexp.global));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T8;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u0069 (i);
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T8;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u0069 (i);
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,17 +21,11 @@ assertion: "RegularExpressionFlags :: IdentifierPart",
|
|||
description: "IdentifierPart :: \\u0069 (i)",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
|
||||
//Test262 Change
|
||||
//var regexp = /(?:)/\u0069;
|
||||
|
||||
var regexp;
|
||||
eval('regexp = /(?:)/\\u0069;');
|
||||
|
||||
if (regexp.ignoreCase !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u0069; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase));
|
||||
}
|
||||
//CHECK#1
|
||||
var regexp = /(?:)/\u0069;
|
||||
if (regexp.ignoreCase !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u0069; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T9;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u006D (m);
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S7.8.5_A3.1_T9;
|
||||
* @section: 7.8.5, 15.10.4.1;
|
||||
* @assertion: RegularExpressionFlags :: IdentifierPart;
|
||||
* @description: IdentifierPart :: \u006D (m);
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,16 +21,11 @@ assertion: "RegularExpressionFlags :: IdentifierPart",
|
|||
description: "IdentifierPart :: \\u006D (m)",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
|
||||
//Test262 Change
|
||||
//var regexp = /(?:)/\u006D;
|
||||
var regexp;
|
||||
eval('regexp = /(?:)/\\u006D;');
|
||||
|
||||
if (regexp.multiline !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u006D; regexp.multiline === true. Actual: ' + (regexp.multiline));
|
||||
}
|
||||
//CHECK#1
|
||||
var regexp = /(?:)/\u006D;
|
||||
if (regexp.multiline !== true) {
|
||||
$ERROR('#1: var regexp = /(?:)/\\u006D; regexp.multiline === true. Actual: ' + (regexp.multiline));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.10_A3.3_T4;
|
||||
* @section: 12.10;
|
||||
* @assertion: No matter how control leaves the embedded 'Statement',
|
||||
* the scope chain is always restored to its former state;
|
||||
* @description: Declaring "with" statement within a function constructor, leading to completion by exception;
|
||||
* @strict_mode_negative
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.10_A3.3_T4;
|
||||
* @section: 12.10;
|
||||
* @assertion: No matter how control leaves the embedded 'Statement', the scope chain is always restored to its former state;
|
||||
* @description: Declaring "with" statement within a function constructor, leading to completion by exception;
|
||||
* @strict_mode_negative
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -18,56 +17,57 @@ id: "S12.10_A3.3_T4",
|
|||
|
||||
path: "12_Statement\12.10_The_with_Statement\S12.10_A3.3_T4.js",
|
||||
|
||||
assertion: "No matter how control leaves the embedded \'Statement\',",
|
||||
assertion: "No matter how control leaves the embedded \'Statement\', the scope chain is always restored to its former state",
|
||||
|
||||
description: "Declaring \"with\" statement within a function constructor, leading to completion by exception",
|
||||
|
||||
test: function testcase() {
|
||||
this.p1 = 1;
|
||||
|
||||
var result = "result";
|
||||
|
||||
var myObj = {
|
||||
p1: 'a',
|
||||
value: 'myObj_value',
|
||||
valueOf : function(){return 'obj_valueOf';}
|
||||
}
|
||||
|
||||
try {
|
||||
function __FACTORY(){
|
||||
with(myObj){
|
||||
p1 = 'x1';
|
||||
throw value;
|
||||
}
|
||||
}
|
||||
var obj = new __FACTORY();
|
||||
} catch(e){
|
||||
result = p1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if(result !== 1){
|
||||
$ERROR('#1: result === 1. Actual: result ==='+ result );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if(p1 !== 1){
|
||||
$ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#3
|
||||
if(myObj.p1 !== "x1"){
|
||||
$ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
this.p1 = 1;
|
||||
|
||||
var result = "result";
|
||||
|
||||
var myObj = {
|
||||
p1: 'a',
|
||||
value: 'myObj_value',
|
||||
valueOf : function(){return 'obj_valueOf';}
|
||||
};
|
||||
|
||||
function __FACTORY(){
|
||||
with(myObj){
|
||||
var p1 = 'x1';
|
||||
throw value;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var obj = new __FACTORY();
|
||||
} catch(e){
|
||||
result = p1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (result !== 1) {
|
||||
$ERROR('#1: result === 1. Actual: result ==='+ result );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (p1 !== 1) {
|
||||
$ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#3
|
||||
if (myObj.p1 !== "x1") {
|
||||
$ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.14_A14;
|
||||
* @section: 12.14;
|
||||
* @assertion: Using "try" with "catch" or "finally" statement within/without a "with" statement;
|
||||
* @description: Using try/catch/finally in With and With in try/catch/finally;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.14_A14;
|
||||
* @section: 12.14;
|
||||
* @assertion: Using "try" with "catch" or "finally" statement within/without a "with" statement;
|
||||
* @description: Using try/catch/finally in With and With in try/catch/finally;
|
||||
* @strict_mode_negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,73 +22,73 @@ assertion: "Using \"try\" with \"catch\" or \"finally\" statement within/without
|
|||
description: "Using try/catch/finally in With and With in try/catch/finally",
|
||||
|
||||
test: function testcase() {
|
||||
var myObj = {p1: 'a',
|
||||
p2: 'b',
|
||||
p3: 'c',
|
||||
value: 'myObj_value',
|
||||
valueOf : function(){return 'obj_valueOf';},
|
||||
parseInt : function(){return 'obj_parseInt';},
|
||||
NaN : 'obj_NaN',
|
||||
Infinity : 'obj_Infinity',
|
||||
eval : function(){return 'obj_eval';},
|
||||
parseFloat : function(){return 'obj_parseFloat';},
|
||||
isNaN : function(){return 'obj_isNaN';},
|
||||
isFinite : function(){return 'obj_isFinite';}
|
||||
}
|
||||
|
||||
// CHECK#1
|
||||
try{
|
||||
with(myObj){
|
||||
throw "ex";
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e );
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
with(myObj){
|
||||
try{
|
||||
throw p1;
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="a") $ERROR('#2.1: Exception ==="a". Actual: Exception ==='+ e );
|
||||
p1='pass';
|
||||
}
|
||||
}
|
||||
if(myObj.p1!=='pass') $ERROR('#2.2: "throw p1" lead to throwing exception');
|
||||
|
||||
// CHECK#3
|
||||
with(myObj){
|
||||
try{
|
||||
p1='fail';
|
||||
throw p2;
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="b") $ERROR('#3.1: Exception ==="b". Actual: Exception ==='+ e );
|
||||
p1='pass';
|
||||
}
|
||||
finally{
|
||||
p2='pass';
|
||||
}
|
||||
}
|
||||
if(myObj.p1!=='pass') $ERROR('#3.2: "throw p2" lead to throwing exception');
|
||||
if(myObj.p2!=='pass') $ERROR('#3.3: "finally" block must be evaluated');
|
||||
|
||||
// CHECK#4
|
||||
myObj.p1='fail';
|
||||
try{
|
||||
with(myObj){
|
||||
try{
|
||||
throw p3;
|
||||
}
|
||||
finally{
|
||||
p1='pass';
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
if(myObj.p1!=='pass') $ERROR('#4: "finally" block must be evaluated');
|
||||
var myObj = {p1: 'a',
|
||||
p2: 'b',
|
||||
p3: 'c',
|
||||
value: 'myObj_value',
|
||||
valueOf : function(){return 'obj_valueOf';},
|
||||
parseInt : function(){return 'obj_parseInt';},
|
||||
NaN : 'obj_NaN',
|
||||
Infinity : 'obj_Infinity',
|
||||
eval : function(){return 'obj_eval';},
|
||||
parseFloat : function(){return 'obj_parseFloat';},
|
||||
isNaN : function(){return 'obj_isNaN';},
|
||||
isFinite : function(){return 'obj_isFinite';}
|
||||
}
|
||||
|
||||
// CHECK#1
|
||||
try{
|
||||
with(myObj){
|
||||
throw "ex";
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e );
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
with(myObj){
|
||||
try{
|
||||
throw p1;
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="a") $ERROR('#2.1: Exception ==="a". Actual: Exception ==='+ e );
|
||||
p1='pass';
|
||||
}
|
||||
}
|
||||
if(myObj.p1!=='pass') $ERROR('#2.2: "throw p1" lead to throwing exception');
|
||||
|
||||
// CHECK#3
|
||||
with(myObj){
|
||||
try{
|
||||
p1='fail';
|
||||
throw p2;
|
||||
}
|
||||
catch(e){
|
||||
if (e!=="b") $ERROR('#3.1: Exception ==="b". Actual: Exception ==='+ e );
|
||||
p1='pass';
|
||||
}
|
||||
finally{
|
||||
p2='pass';
|
||||
}
|
||||
}
|
||||
if(myObj.p1!=='pass') $ERROR('#3.2: "throw p2" lead to throwing exception');
|
||||
if(myObj.p2!=='pass') $ERROR('#3.3: "finally" block must be evaluated');
|
||||
|
||||
// CHECK#4
|
||||
myObj.p1='fail';
|
||||
try{
|
||||
with(myObj){
|
||||
try{
|
||||
throw p3;
|
||||
}
|
||||
finally{
|
||||
p1='pass';
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
if(myObj.p1!=='pass') $ERROR('#4: "finally" block must be evaluated');
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.14_A4;
|
||||
* @section: 12.14;
|
||||
* @assertion: Sanity test for "catch(Indetifier) statement";
|
||||
* @description: Checking if deleting an exception fails;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.14_A4;
|
||||
* @section: 12.14;
|
||||
* @assertion: Sanity test for "catch(Indetifier) statement";
|
||||
* @description: Checking if deleting an exception fails;
|
||||
* @strict_mode_negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,31 +22,31 @@ assertion: "Sanity test for \"catch(Indetifier) statement\"",
|
|||
description: "Checking if deleting an exception fails",
|
||||
|
||||
test: function testcase() {
|
||||
// CHECK#1
|
||||
try {
|
||||
throw "catchme";
|
||||
$ERROR('#1.1: throw "catchme" lead to throwing exception');
|
||||
}
|
||||
catch (e) {
|
||||
if (delete e){
|
||||
$ERROR('#1.2: Exception has DontDelete property');
|
||||
}
|
||||
if (e!=="catchme") {
|
||||
$ERROR('#1.3: Exception === "catchme". Actual: Exception ==='+ e );
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
try {
|
||||
throw "catchme";
|
||||
$ERROR('#2.1: throw "catchme" lead to throwing exception');
|
||||
}
|
||||
catch(e){}
|
||||
try{
|
||||
e;
|
||||
$ERROR('#2.2: Deleting catching exception after ending "catch" block');
|
||||
}
|
||||
catch(err){}
|
||||
// CHECK#1
|
||||
try {
|
||||
throw "catchme";
|
||||
$ERROR('#1.1: throw "catchme" lead to throwing exception');
|
||||
}
|
||||
catch (e) {
|
||||
if (delete e){
|
||||
$ERROR('#1.2: Exception has DontDelete property');
|
||||
}
|
||||
if (e!=="catchme") {
|
||||
$ERROR('#1.3: Exception === "catchme". Actual: Exception ==='+ e );
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK#2
|
||||
try {
|
||||
throw "catchme";
|
||||
$ERROR('#2.1: throw "catchme" lead to throwing exception');
|
||||
}
|
||||
catch(e){}
|
||||
try{
|
||||
e;
|
||||
$ERROR('#2.2: Deleting catching exception after ending "catch" block');
|
||||
}
|
||||
catch(err){}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.1_A1;
|
||||
* @section: 12.1;
|
||||
* @assertion: The production Block { } in strict code can't contain function declaration;
|
||||
* @description: Trying to declare function at the Block statement;
|
||||
* @negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
{
|
||||
function __func(){}
|
||||
}
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S12.1_A1",
|
||||
|
||||
path: "12_Statement\12.1_Block\S12.1_A1.js",
|
||||
|
||||
assertion: "The production Block { } in strict code can\'t contain function declaration",
|
||||
|
||||
description: "Trying to declare function at the Block statement",
|
||||
|
||||
test: function testcase() {
|
||||
"use strict";
|
||||
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||
|
||||
{
|
||||
function __func(){}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.5_A7;
|
||||
* @section: 12.5;
|
||||
* @assertion: In the "if" statement empty statement is allowed and is evaluated to "undefined";
|
||||
* @description: Checking by using eval "eval("if(1);"))";
|
||||
*/
|
||||
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.5_A7;
|
||||
* @section: 12.5;
|
||||
* @assertion: In the "if" statement empty statement is allowed and is evaluated to "undefined";
|
||||
* @description: Checking by using eval "eval("if(1);"))";
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -22,20 +22,20 @@ assertion: "In the \"if\" statement empty statement is allowed and is evaluated
|
|||
description: "Checking by using eval \"eval(\"if(1);\"))\"",
|
||||
|
||||
test: function testcase() {
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
try {
|
||||
__evaluated = eval("if(1);");
|
||||
if (__evaluated !== undefined) {
|
||||
$ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
$ERROR('#1.1: "__evaluated = eval("if(1);")" does not lead to throwing exception');
|
||||
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
try {
|
||||
var __evaluated = eval("if(1);");
|
||||
if (__evaluated !== undefined) {
|
||||
$ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
$ERROR('#1.1: "__evaluated = eval("if(1);")" does not lead to throwing exception');
|
||||
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,36 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.5_A9_T1;
|
||||
* @section: 12.5;
|
||||
* @assertion: Function declaration within an "if" statement in strict code is not allowed;
|
||||
* @description: Declaring function within an "if" statement;
|
||||
* @negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
if (true) {
|
||||
function __func(){};
|
||||
} else {
|
||||
function __func(){};
|
||||
}
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S12.5_A9_T1",
|
||||
|
||||
path: "12_Statement\12.5_The_if_Statement\S12.5_A9_T1.js",
|
||||
|
||||
assertion: "Function declaration within an \"if\" statement in strict code is not allowed",
|
||||
|
||||
description: "Declaring function within an \"if\" statement",
|
||||
|
||||
test: function testcase() {
|
||||
"use strict";
|
||||
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||
|
||||
if (true) {
|
||||
function __func(){};
|
||||
} else {
|
||||
function __func(){};
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,17 +1,38 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.5_A9_T2;
|
||||
* @section: 12.5;
|
||||
* @assertion: Function declaration within an "if" statement in strict code is not allowed;
|
||||
* @description: Declaring function within an "if" that is declared within the strict function;
|
||||
* @negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
(function(){
|
||||
ES5Harness.registerTest( {
|
||||
id: "S12.5_A9_T2",
|
||||
|
||||
if (true) {
|
||||
function __func(){};
|
||||
} else {
|
||||
function __func(){};
|
||||
}
|
||||
path: "12_Statement\12.5_The_if_Statement\S12.5_A9_T2.js",
|
||||
|
||||
})();
|
||||
|
||||
assertion: "Function declaration within an \"if\" statement in strict code is not allowed",
|
||||
|
||||
description: "Declaring function within an \"if\" that is declared within the strict function",
|
||||
|
||||
test: function testcase() {
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
if (true) {
|
||||
function __func(){};
|
||||
} else {
|
||||
function __func(){};
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.6.1_A1;
|
||||
* @section: 12.6.1;
|
||||
* @assertion: When the production "do Statement while ( Expression )" is evaluated, Statement is evaluated first;
|
||||
* @description: Evaluating various Expressions;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.6.1_A1;
|
||||
* @section: 12.6.1;
|
||||
* @assertion: When the production "do Statement while ( Expression )" is evaluated, Statement is evaluated first;
|
||||
* @description: Evaluating various Expressions;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,35 +21,37 @@ assertion: "When the production \"do Statement while ( Expression )\" is evaluat
|
|||
description: "Evaluating various Expressions",
|
||||
|
||||
test: function testcase() {
|
||||
do __in__do=1; while ( false );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__in__do!==1) {
|
||||
$ERROR('#1: false evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
do __in__do=2; while ( 0 );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (__in__do!==2) {
|
||||
$ERROR('#2: 0 evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
do __in__do=3; while ( "" );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#3
|
||||
if (__in__do!==3) {
|
||||
$ERROR('#3: "" evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
var __in__do;
|
||||
|
||||
do __in__do=1; while ( false );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__in__do!==1) {
|
||||
$ERROR('#1: false evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
do __in__do=2; while ( 0 );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (__in__do!==2) {
|
||||
$ERROR('#2: 0 evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
do __in__do=3; while ( "" );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#3
|
||||
if (__in__do!==3) {
|
||||
$ERROR('#3: "" evaluates to false');
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.6.1_A13_T1;
|
||||
* @section: 12.6.1, 13;
|
||||
* @assertion: FunctionDeclaration within a "do-while" Block in strict code is not allowed;
|
||||
* @description: Declaring function within a "do-while" loop;
|
||||
* @negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
do{
|
||||
function __func(){};
|
||||
} while(0);
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S12.6.1_A13_T1",
|
||||
|
||||
path: "12_Statement\12.6_Iteration_Statements\12.6.1_The_do_while_Statement\S12.6.1_A13_T1.js",
|
||||
|
||||
assertion: "FunctionDeclaration within a \"do-while\" Block in strict code is not allowed",
|
||||
|
||||
description: "Declaring function within a \"do-while\" loop",
|
||||
|
||||
test: function testcase() {
|
||||
"use strict";
|
||||
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||
|
||||
do{
|
||||
function __func(){};
|
||||
} while(0);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,15 +1,35 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S12.6.1_A13_T2;
|
||||
* @section: 12.6.1, 13;
|
||||
* @assertion: FunctionDeclaration within a "do-while" Block in strict code is not allowed;
|
||||
* @description: Declaring a function within a "do-while" loop that is within a strict function;
|
||||
* @negative SyntaxError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
(function(){
|
||||
ES5Harness.registerTest( {
|
||||
id: "S12.6.1_A13_T2",
|
||||
|
||||
do{
|
||||
function __func(){};
|
||||
}while(0);
|
||||
path: "12_Statement\12.6_Iteration_Statements\12.6.1_The_do_while_Statement\S12.6.1_A13_T2.js",
|
||||
|
||||
})();
|
||||
|
||||
assertion: "FunctionDeclaration within a \"do-while\" Block in strict code is not allowed",
|
||||
|
||||
description: "Declaring a function within a \"do-while\" loop that is within a strict function",
|
||||
|
||||
test: function testcase() {
|
||||
(function(){
|
||||
"use strict";
|
||||
do{
|
||||
function __func(){};
|
||||
}while(0);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.10.6.2_A12;
|
||||
* @section: 15.10.6.2;
|
||||
* @assertion: regExp exec() acts like regExp.exec('undefined') (step 2);
|
||||
* @description: Checking RegExp.prototype.exec.length;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.10.6.2_A12",
|
||||
|
||||
path: "15_Native\15.10_RegExp_Objects\15.10.6_Properties_of_the_RegExp_Prototype_Object\15.10.6.2_RegExp.prototype.exec\S15.10.6.2_A12.js",
|
||||
|
||||
assertion: "regExp exec() acts like regExp.exec(\'undefined\') (step 2)",
|
||||
|
||||
description: "Checking RegExp.prototype.exec.length",
|
||||
|
||||
test: function testcase() {
|
||||
(/foo/).test('xfoox');
|
||||
var match = new RegExp('(.|\r|\n)*','').exec()[0];
|
||||
if (match === 'xfoox') {
|
||||
$FAIL('#1: regExp.exec() leaks match globally');
|
||||
}
|
||||
if (match !== 'undefined') {
|
||||
$FAIL('#2: regExp.exec() must coerce absent first arg to "undefined"');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.12.2_A1;
|
||||
* @section: 15.12.2;
|
||||
* @assertion: JSON.parse must create a property with the given property name;
|
||||
* @description: Tests that JSON.parse treats "__proto__" as a regular property name;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.12.2_A1",
|
||||
|
||||
path: "15_Native\15.12_The_JSON_Object\15.12.2_JSON.parse\S15.12.2_A1.js",
|
||||
|
||||
assertion: "JSON.parse must create a property with the given property name",
|
||||
|
||||
description: "Tests that JSON.parse treats \"__proto__\" as a regular property name",
|
||||
|
||||
test: function testcase() {
|
||||
var x = JSON.parse('{"__proto__":[]}');
|
||||
if (Object.getPrototypeOf(x) !== Object.prototype) {
|
||||
$FAIL('#1: JSON.parse confused by "__proto__"');
|
||||
}
|
||||
if (!Array.isArray(x.__proto__)) {
|
||||
$FAIL('#2: JSON.parse did not set "__proto__" as a regular property');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.2.4.2_A12;
|
||||
* @section: 15.2.4.2;
|
||||
* @assertion: If the this value is undefined, return "[object Undefined]".
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.2.4.2_A12",
|
||||
|
||||
path: "15_Native\15.2_Object_Objects\15.2.4_Properties_of_the_Object_Prototype_Object\15.2.4.2_Object.prototype.toString\S15.2.4.2_A12.js",
|
||||
|
||||
assertion: "If the this value is undefined, return \"[object Undefined]\".",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
if (Object.prototype.toString.call(undefined) !== "[object Undefined]") {
|
||||
$ERROR('If the this value is undefined, return "[object Undefined]".');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.2.4.2_A13;
|
||||
* @section: 15.2.4.2;
|
||||
* @assertion: If the this value is null, return "[object Null]".
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.2.4.2_A13",
|
||||
|
||||
path: "15_Native\15.2_Object_Objects\15.2.4_Properties_of_the_Object_Prototype_Object\15.2.4.2_Object.prototype.toString\S15.2.4.2_A13.js",
|
||||
|
||||
assertion: "If the this value is null, return \"[object Null]\".",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
if (Object.prototype.toString.call(null) !== "[object Null]") {
|
||||
$ERROR('If the this value is null, return "[object Null]".');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.2.4.2_A14;
|
||||
* @section: 15.2.4.2;
|
||||
* @assertion: Let O be the result of calling ToObject passing the this value as the argument.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.2.4.2_A14",
|
||||
|
||||
path: "15_Native\15.2_Object_Objects\15.2.4_Properties_of_the_Object_Prototype_Object\15.2.4.2_Object.prototype.toString\S15.2.4.2_A14.js",
|
||||
|
||||
assertion: "Let O be the result of calling ToObject passing the this value as the argument.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
if (Object.prototype.toString.call(33) !== "[object Number]") {
|
||||
$ERROR('Let O be the result of calling ToObject passing the this ' +
|
||||
'value as the argument.');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.2.4.2_A15;
|
||||
* @section: 15.2.4.2;
|
||||
* @assertion: Let O be the result of calling ToObject passing the this value as the argument.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.2.4.2_A15",
|
||||
|
||||
path: "15_Native\15.2_Object_Objects\15.2.4_Properties_of_the_Object_Prototype_Object\15.2.4.2_Object.prototype.toString\S15.2.4.2_A15.js",
|
||||
|
||||
assertion: "Let O be the result of calling ToObject passing the this value as the argument.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
if (Object.prototype.toString.call(true) !== "[object Boolean]") {
|
||||
$ERROR('Let O be the result of calling ToObject passing the this ' +
|
||||
'value as the argument.');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.2.4.2_A16;
|
||||
* @section: 15.2.4.2;
|
||||
* @assertion: Let O be the result of calling ToObject passing the this value as the argument.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.2.4.2_A16",
|
||||
|
||||
path: "15_Native\15.2_Object_Objects\15.2.4_Properties_of_the_Object_Prototype_Object\15.2.4.2_Object.prototype.toString\S15.2.4.2_A16.js",
|
||||
|
||||
assertion: "Let O be the result of calling ToObject passing the this value as the argument.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
if (Object.prototype.toString.call('foo') !== "[object String]") {
|
||||
$ERROR('Let O be the result of calling ToObject passing the this ' +
|
||||
'value as the argument.');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.toLocaleString.call(undefined);
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.toLocaleString.call(null);
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.valueOf.call(undefined);
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.valueOf.call(null);
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
(1,Object.prototype.valueOf)();
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.hasOwnProperty.call(undefined, 'foo');
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.hasOwnProperty.call(null, 'foo');
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.isPrototypeOf.call(undefined, {});
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.isPrototypeOf.call(null, {});
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.propertyIsEnumerable.call(undefined, 'foo');
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
Object.prototype.propertyIsEnumerable.call(null, 'foo');
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A10;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The Function.prototype.toString.length property has the attribute ReadOnly;
|
||||
* @description: Checking if varying the Function.prototype.toString.length property fails;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A10;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The Function.prototype.toString.length property has the attribute ReadOnly;
|
||||
* @description: Checking if varying the Function.prototype.toString.length property fails;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,19 +21,19 @@ assertion: "The Function.prototype.toString.length property has the attribute Re
|
|||
description: "Checking if varying the Function.prototype.toString.length property fails",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
if (!(Function.prototype.toString.hasOwnProperty('length'))) {
|
||||
$FAIL('#1: the Function.prototype.toString has length property.');
|
||||
}
|
||||
|
||||
obj = Function.prototype.toString.length;
|
||||
|
||||
Function.prototype.toString.length = function(){return "shifted";};
|
||||
|
||||
//CHECK#2
|
||||
if (Function.prototype.toString.length !== obj) {
|
||||
$ERROR('#2: the Function.prototype.toString length property has the attributes ReadOnly.');
|
||||
}
|
||||
//CHECK#1
|
||||
if (!(Function.prototype.toString.hasOwnProperty('length'))) {
|
||||
$FAIL('#1: the Function.prototype.toString has length property.');
|
||||
}
|
||||
|
||||
var obj = Function.prototype.toString.length;
|
||||
|
||||
Function.prototype.toString.length = function(){return "shifted";};
|
||||
|
||||
//CHECK#2
|
||||
if (Function.prototype.toString.length !== obj) {
|
||||
$ERROR('#2: the Function.prototype.toString length property has the attributes ReadOnly.');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A12;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The Function.prototype.toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.2_A12",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.2_Function.prototype.toString\S15.3.4.2_A12.js",
|
||||
|
||||
assertion: "The Function.prototype.toString function is not generic; it throws a TypeError exception if its this value is not a Function object.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.toString.call(undefined);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A13;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.2_A13",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.2_Function.prototype.toString\S15.3.4.2_A13.js",
|
||||
|
||||
assertion: "The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.toString.call(null);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A14;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.2_A14",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.2_Function.prototype.toString\S15.3.4.2_A14.js",
|
||||
|
||||
assertion: "The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.toString.call({});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A15;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
|
||||
* @description: Whether or not they are callable, RegExp objects are not Function objects, so toString should throw a TypeError.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.2_A15",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.2_Function.prototype.toString\S15.3.4.2_A15.js",
|
||||
|
||||
assertion: "The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.",
|
||||
|
||||
description: "Whether or not they are callable, RegExp objects are not Function objects, so toString should throw a TypeError.",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.toString.call(/x/);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A16;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
|
||||
* @description: The String constructor, given an object, should invoke that object's toString method as a method, i.e., with its this value bound to that object.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.2_A16",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.2_Function.prototype.toString\S15.3.4.2_A16.js",
|
||||
|
||||
assertion: "The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.",
|
||||
|
||||
description: "The String constructor, given an object, should invoke that object\'s toString method as a method, i.e., with its this value bound to that object.",
|
||||
|
||||
test: function testcase() {
|
||||
var obj = {toString: Function.prototype.toString};
|
||||
|
||||
String(obj);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A1_T1;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration;
|
||||
* @description: For testing use Function.prototype.toString() function;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.2_A1_T1;
|
||||
* @section: 15.3.4.2;
|
||||
* @assertion: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration;
|
||||
* @description: For testing use Function.prototype.toString() function;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,14 +21,14 @@ assertion: "An implementation-dependent representation of the function is return
|
|||
description: "For testing use Function.prototype.toString() function",
|
||||
|
||||
test: function testcase() {
|
||||
f = function(x) {
|
||||
return x*x;
|
||||
}
|
||||
|
||||
//CHECK#1
|
||||
if (eval(f.toString())(10) !== f(10)) {
|
||||
$ERROR('#1: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration');
|
||||
}
|
||||
var f = function(x) {
|
||||
return x*x;
|
||||
};
|
||||
|
||||
//CHECK#1
|
||||
if (eval(f.toString())(10) !== f(10)) {
|
||||
$ERROR('#1: An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.3_A13;
|
||||
* @section: 15.3.4.3;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.3_A13",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.3_Function.prototype.apply\S15.3.4.3_A13.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.apply.call(undefined, {}, []);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.3_A14;
|
||||
* @section: 15.3.4.3;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.3_A14",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.3_Function.prototype.apply\S15.3.4.3_A14.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.apply.call(null, {}, []);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.3_A15;
|
||||
* @section: 15.3.4.3;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.3_A15",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.3_Function.prototype.apply\S15.3.4.3_A15.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.apply.call({}, {}, []);
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.3_A16;
|
||||
* @section: 15.3.4.3;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @description: A RegExp is not a function, but it may be callable. Iff it is, it's typeof should be 'function', in which case apply should accept it as a valid this value.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.3_A16",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.3_Function.prototype.apply\S15.3.4.3_A16.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "A RegExp is not a function, but it may be callable. Iff it is, it\'s typeof should be \'function\', in which case apply should accept it as a valid this value.",
|
||||
|
||||
test: function testcase() {
|
||||
var re = (/x/);
|
||||
if (typeof re === 'function') {
|
||||
Function.prototype.apply.call(re, undefined, ['x']);
|
||||
} else {
|
||||
try {
|
||||
Function.prototype.bind.call(re, undefined);
|
||||
$FAIL('#1: If IsCallable(func) is false, ' +
|
||||
'then (bind should) throw a TypeError exception');
|
||||
} catch (e) {
|
||||
if (!(e instanceof TypeError)) {
|
||||
$ERROR('#1: TypeError expected. Actual: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.4_A13;
|
||||
* @section: 15.3.4.4;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.4_A13",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.4_Function.prototype.call\S15.3.4.4_A13.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.call.call(undefined, {});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.4_A14;
|
||||
* @section: 15.3.4.4;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.4_A14",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.4_Function.prototype.call\S15.3.4.4_A14.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.call.call(null, {});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.4_A15;
|
||||
* @section: 15.3.4.4;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.4_A15",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.4_Function.prototype.call\S15.3.4.4_A15.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.call.call({}, {});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.4_A16;
|
||||
* @section: 15.3.4.4;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @description: A RegExp is not a function, but it may be callable. Iff it is, it's typeof should be 'function', in which case call should accept it as a valid this value.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.4_A16",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.4_Function.prototype.call\S15.3.4.4_A16.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "A RegExp is not a function, but it may be callable. Iff it is, it\'s typeof should be \'function\', in which case call should accept it as a valid this value.",
|
||||
|
||||
test: function testcase() {
|
||||
var re = (/x/);
|
||||
if (typeof re === 'function') {
|
||||
Function.prototype.call.call(re, undefined, 'x');
|
||||
} else {
|
||||
try {
|
||||
Function.prototype.bind.call(re, undefined);
|
||||
$FAIL('#1: If IsCallable(func) is false, ' +
|
||||
'then (bind should) throw a TypeError exception');
|
||||
} catch (e) {
|
||||
if (!(e instanceof TypeError)) {
|
||||
$ERROR('#1: TypeError expected. Actual: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A1;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: "caller" of bound function is poisoned (step 20);
|
||||
* @description A bound function should fail to find its "caller";
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A1",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A1.js",
|
||||
|
||||
assertion: "\"caller\" of bound function is poisoned (step 20)",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
function foo() { return bar.caller; }
|
||||
var bar = foo.bind({});
|
||||
function baz() { return bar(); }
|
||||
baz();
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A13;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A13",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A13.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.bind.call(undefined, {});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A14;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A14",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A14.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.bind.call(null, {});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A15;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A15",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A15.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
Function.prototype.bind.call({}, {});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A16;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
|
||||
* @description: A RegExp is not a function, but it may be callable. Iff it is, it's typeof should be 'function', in which case bind should accept it as a valid this value.
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A16",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A16.js",
|
||||
|
||||
assertion: "If IsCallable(func) is false, then throw a TypeError exception.",
|
||||
|
||||
description: "A RegExp is not a function, but it may be callable. Iff it is, it\'s typeof should be \'function\', in which case bind should accept it as a valid this value.",
|
||||
|
||||
test: function testcase() {
|
||||
var re = (/x/);
|
||||
if (typeof re === 'function') {
|
||||
Function.prototype.bind.call(re, undefined);
|
||||
} else {
|
||||
try {
|
||||
Function.prototype.bind.call(re, undefined);
|
||||
$FAIL('#1: If IsCallable(func) is false, ' +
|
||||
'then (bind should) throw a TypeError exception');
|
||||
} catch (e) {
|
||||
if (!(e instanceof TypeError)) {
|
||||
$ERROR('#1: TypeError expected. Actual: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4.5_A1;
|
||||
* @section: 15.3.4.5;
|
||||
* @assertion: "arguments" of bound function is poisoned (step 21);
|
||||
* @description a bound function should fail to find the bound function "arguments";
|
||||
* @negative TypeError;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.3.4.5_A2",
|
||||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\15.3.4.5_Function.prototype.bind\S15.3.4.5_A2.js",
|
||||
|
||||
assertion: "\"arguments\" of bound function is poisoned (step 21)",
|
||||
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
function foo() { return bar.arguments; }
|
||||
var bar = foo.bind({});
|
||||
function baz() { return bar(); }
|
||||
baz();
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4_A1;
|
||||
* @section: 15.3.4;
|
||||
* @assertion: The Function prototype object is itself a Function object (its [[Class]] is "Function");
|
||||
* @description: first we delete Function.prototype.toString cause it overrides Object prototype toString.
|
||||
* Object.prototype.toString returns [object+[[class]]+];
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4_A1;
|
||||
* @section: 15.3.4;
|
||||
* @assertion: The Function prototype object is itself a Function object (its [[Class]] is "Function");
|
||||
* @description: Object.prototype.toString returns [object+[[Class]]+];
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -19,15 +18,13 @@ path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototy
|
|||
|
||||
assertion: "The Function prototype object is itself a Function object (its [[Class]] is \"Function\")",
|
||||
|
||||
description: "first we delete Function.prototype.toString cause it overrides Object prototype toString.",
|
||||
description: "Object.prototype.toString returns [object+[[Class]]+]",
|
||||
|
||||
test: function testcase() {
|
||||
delete Function.prototype.toString;
|
||||
|
||||
//CHECK#1
|
||||
if (Function.prototype.toString() !== "[object "+"Function"+"]") {
|
||||
$ERROR('#1: The Function prototype object is itself a Function object (its [[Class]] is "Function")');
|
||||
}
|
||||
if (Object.prototype.toString.call(Function.prototype) !== "[object Function]") {
|
||||
$ERROR('#2: The Function prototype object is itself a Function ' +
|
||||
'object (its [[Class]] is "Function") (15.3.4)');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4_A3_T1;
|
||||
* @section: 15.3.4, 15.3.2.1;
|
||||
* @assertion: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1);
|
||||
* @description: Checking prototype of Function.prototype;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.4_A3_T1;
|
||||
* @section: 15.3.4;
|
||||
* @assertion: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.4);
|
||||
* @description: Checking prototype of Function.prototype;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -16,22 +16,16 @@ id: "S15.3.4_A3_T1",
|
|||
|
||||
path: "15_Native\15.3_Function_Objects\15.3.4_Properties_of_the_Function_Prototype_Object\S15.3.4_A3_T1.js",
|
||||
|
||||
assertion: "The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)",
|
||||
assertion: "The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.4)",
|
||||
|
||||
description: "Checking prototype of Function.prototype",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
if (!(Object.prototype.isPrototypeOf(Function.prototype))) {
|
||||
$ERROR('#1: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
|
||||
}
|
||||
|
||||
delete Function.prototype.toString;
|
||||
|
||||
//CHECK#2
|
||||
if (Function.prototype.toString() !== "[object "+"Function"+"]") {
|
||||
$ERROR('#2: The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (15.3.2.1)');
|
||||
}
|
||||
if (Object.getPrototypeOf(Function.prototype) !== Object.prototype) {
|
||||
$ERROR('#1: The value of the internal [[Prototype]] property of ' +
|
||||
'the Function prototype object is the Object prototype ' +
|
||||
'object (15.3.4)');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5.1_A1_T1;
|
||||
* @section: 15.3.5.1;
|
||||
* @assertion: The value of the length property is usually an integer that indicates the 'typical' number of arguments expected by the function;
|
||||
* @description: Checking length property of Function("arg1,arg2,arg3", null);
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5.1_A1_T1;
|
||||
* @section: 15.3.5.1;
|
||||
* @assertion: The value of the length property is usually an integer that indicates the 'typical' number of arguments expected by the function;
|
||||
* @description: Checking length property of Function("arg1,arg2,arg3", null);
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,17 +21,17 @@ assertion: "The value of the length property is usually an integer that indicate
|
|||
description: "Checking length property of Function(\"arg1,arg2,arg3\", null)",
|
||||
|
||||
test: function testcase() {
|
||||
f = new Function("arg1,arg2,arg3", null);
|
||||
|
||||
//CHECK#1
|
||||
if (!(f.hasOwnProperty('length'))) {
|
||||
$FAIL('#1: the function has length property.');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (f.length !== 3) {
|
||||
$ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
|
||||
}
|
||||
f = new Function("arg1,arg2,arg3", null);
|
||||
|
||||
//CHECK#1
|
||||
if (!(f.hasOwnProperty('length'))) {
|
||||
$FAIL('#1: the function has length property.');
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (f.length !== 3) {
|
||||
$ERROR('#2: The value of the length property is usually an integer that indicates the "typical" number of arguments expected by the function');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5_A1_T1;
|
||||
* @section: 15.3.5;
|
||||
* @assertion: The value of the [[Class]] property is "Function" ;
|
||||
* @description: We delete Function.prototype.toString method to access Object.prototype.toString method.
|
||||
* For testing use variable f = new Function;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5_A1_T1;
|
||||
* @section: 15.3.5;
|
||||
* @assertion: The value of the [[Class]] property is "Function";
|
||||
* @description: For testing use variable f = new Function;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -19,18 +18,14 @@ path: "15_Native\15.3_Function_Objects\15.3.5_Properties_of_Function_Instances\S
|
|||
|
||||
assertion: "The value of the [[Class]] property is \"Function\"",
|
||||
|
||||
description: "We delete Function.prototype.toString method to access Object.prototype.toString method.",
|
||||
description: "For testing use variable f = new Function",
|
||||
|
||||
test: function testcase() {
|
||||
f = new Function;
|
||||
|
||||
delete Function.prototype.toString;
|
||||
|
||||
//CHECK#1
|
||||
if (f.toString() !== "[object "+"Function"+"]") {
|
||||
$ERROR('#1: The value of the [[Class]] property is "Function"');
|
||||
}
|
||||
|
||||
var f = new Function;
|
||||
|
||||
if (Object.prototype.toString.call(f) !== "[object Function]") {
|
||||
$ERROR('#1: The value of the [[Class]] property is "Function"');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5_A1_T2;
|
||||
* @section: 15.3.5;
|
||||
* @assertion: The value of the [[Class]] property is "Function" ;
|
||||
* @description: We delete Function.prototype.toString method to access Object.prototype.toString method
|
||||
* For testing use variable f = Function();
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.3.5_A1_T2;
|
||||
* @section: 15.3.5;
|
||||
* @assertion: The value of the [[Class]] property is "Function" ;
|
||||
* @description: For testing use variable f = Function();
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -19,18 +18,15 @@ path: "15_Native\15.3_Function_Objects\15.3.5_Properties_of_Function_Instances\S
|
|||
|
||||
assertion: "The value of the [[Class]] property is \"Function\"",
|
||||
|
||||
description: "We delete Function.prototype.toString method to access Object.prototype.toString method",
|
||||
description: "For testing use variable f = Function()",
|
||||
|
||||
test: function testcase() {
|
||||
f = Function();
|
||||
|
||||
delete Function.prototype.toString;
|
||||
|
||||
//CHECK#1
|
||||
if (f.toString() !== "[object "+"Function"+"]") {
|
||||
$ERROR('#1: The value of the [[Class]] property is "Function"');
|
||||
}
|
||||
|
||||
var f = Function();
|
||||
|
||||
if (Object.prototype.toString.call(f) !== "[object Function]") {
|
||||
$ERROR('#1: The value of the [[Class]] property is "Function"');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.4.4.11_A8;
|
||||
* @section: 15.4.4.11;
|
||||
* @assertion: Call the comparefn passing undefined as the this value (step 13b);
|
||||
* @description: comparefn tests that its this value is undefined;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.4.4.11_A8",
|
||||
|
||||
path: "15_Native\15.4_Array_Objects\15.4.4_Properties_of_the_Array_Prototype_Object\15.4.4.11_Array_prototype_sort\S15.4.4.11_A8.js",
|
||||
|
||||
assertion: "Call the comparefn passing undefined as the this value (step 13b)",
|
||||
|
||||
description: "comparefn tests that its this value is undefined",
|
||||
|
||||
test: function testcase() {
|
||||
var global = this;
|
||||
[2,3].sort(function(x,y) {
|
||||
"use strict";
|
||||
|
||||
if (this === global) {
|
||||
$FAIL('#1: Sort leaks global');
|
||||
}
|
||||
if (this !== undefined) {
|
||||
$FAIL('#2: Sort comparefn should be called with this===undefined. ' +
|
||||
'Actual: ' + this);
|
||||
}
|
||||
return x - y;
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.4.4.18_A1;
|
||||
* @section: 15.4.4.18;
|
||||
* @assertion: array.forEach can be frozen while in progress
|
||||
* @description: Freezes array.forEach during a forEach to see if it works
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.4.4.18_A1",
|
||||
|
||||
path: "15_Native\15.4_Array_Objects\15.4.4_Properties_of_the_Array_Prototype_Object\15.4.4.18_Array_prototype_forEach\S15.4.4.18_A1.js",
|
||||
|
||||
assertion: "array.forEach can be frozen while in progress",
|
||||
|
||||
description: "Freezes array.forEach during a forEach to see if it works",
|
||||
|
||||
test: function testcase() {
|
||||
['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.4.4.18_A2;
|
||||
* @section: 15.4.4.18;
|
||||
* @assertion: array.forEach can be frozen while in progress
|
||||
* @description: Freezes array.forEach during a forEach to see if it works
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.4.4.18_A2",
|
||||
|
||||
path: "15_Native\15.4_Array_Objects\15.4.4_Properties_of_the_Array_Prototype_Object\15.4.4.18_Array_prototype_forEach\S15.4.4.18_A2.js",
|
||||
|
||||
assertion: "array.forEach can be frozen while in progress",
|
||||
|
||||
description: "Freezes array.forEach during a forEach to see if it works",
|
||||
|
||||
test: function testcase() {
|
||||
function foo() {
|
||||
['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
|
||||
}
|
||||
foo();
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,15 +1,12 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.4.4_A1.1_T2;
|
||||
* @section: 15.4.4, 11.4.1;
|
||||
* @assertion: The value of the internal [[Prototype]] property of
|
||||
* the Array prototype object is the Object prototype object;
|
||||
* @description: delete Array.prototype.toString;
|
||||
* @strict_mode_negative
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.4.4_A1.1_T2;
|
||||
* @section: 15.4.4;
|
||||
* @assertion:The Array prototype object is itself an array; its [[Class]] is "Array",
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -18,16 +15,16 @@ id: "S15.4.4_A1.1_T2",
|
|||
|
||||
path: "15_Native\15.4_Array_Objects\15.4.4_Properties_of_the_Array_Prototype_Object\S15.4.4_A1.1_T2.js",
|
||||
|
||||
assertion: "The value of the internal [[Prototype]] property of",
|
||||
assertion: "The Array prototype object is itself an array; its [[Class]] is \"Array\",",
|
||||
|
||||
description: "delete Array.prototype.toString",
|
||||
description: "",
|
||||
|
||||
test: function testcase() {
|
||||
//CHECK#1
|
||||
delete Array.prototype.toString;
|
||||
if (Array.prototype.toString() !== "[object " + "Array" + "]") {
|
||||
$ERROR('#1: delete Array.prototype.toString; var Array.prototype = Object(); Array.prototype.toString() === "[object " + "Array" + "]". Actual: ' + (Array.prototype.toString()));
|
||||
}
|
||||
//CHECK#1
|
||||
if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") {
|
||||
$ERROR('The Array prototype object is itself an array; its' +
|
||||
'[[Class]] is "Array".');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright 2011 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.5.4.11_A12;
|
||||
* @section: 15.5.4.11;
|
||||
* @assertion: Call replaceValue passing undefined as the this value;
|
||||
* @description: replaceValue tests that its this value is undefined;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {
|
||||
id: "S15.5.4.11_A12",
|
||||
|
||||
path: "15_Native\15.5_String_Objects\15.5.4_Properties_of_the_String_Prototype_Object\15.5.4.11_String.prototype.replace\S15.5.4.11_A12.js",
|
||||
|
||||
assertion: "Call replaceValue passing undefined as the this value",
|
||||
|
||||
description: "replaceValue tests that its this value is undefined",
|
||||
|
||||
test: function testcase() {
|
||||
var global = this;
|
||||
'x'.replace(/x/, function() {
|
||||
"use strict";
|
||||
|
||||
if (this === global) {
|
||||
$FAIL('#1: String replace leaks global');
|
||||
}
|
||||
if (this !== undefined) {
|
||||
$FAIL('#2: replaceValue should be called with this===undefined. ' +
|
||||
'Actual: ' + this);
|
||||
}
|
||||
return 'y';
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.5.4.8_A1_T1;
|
||||
* @section: 15.5.4.8;
|
||||
* @assertion: String.prototype.lastIndexOf(searchString, position);
|
||||
* @description: Arguments are false and true, and instance is object;
|
||||
*/
|
||||
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @name: S15.5.4.8_A1_T1;
|
||||
* @section: 15.5.4.8;
|
||||
* @assertion: String.prototype.lastIndexOf(searchString, position);
|
||||
* @description: Arguments are false and true, and instance is object;
|
||||
*/
|
||||
|
||||
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
|
@ -21,20 +21,17 @@ assertion: "String.prototype.lastIndexOf(searchString, position)",
|
|||
description: "Arguments are false and true, and instance is object",
|
||||
|
||||
test: function testcase() {
|
||||
var __instance = new Object(true);
|
||||
|
||||
//Test262 Change
|
||||
//var __instance.lastIndexOf = String.prototype.lastIndexOf;
|
||||
__instance.lastIndexOf = String.prototype.lastIndexOf;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__instance.lastIndexOf(true, false) !== 0) {
|
||||
$ERROR('#1: __instance = new Object(true); __instance.lastIndexOf = String.prototype.lastIndexOf; __instance.lastIndexOf(true, false) === 0. Actual: '+__instance.lastIndexOf(true, false) );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
var __instance = new Object(true);
|
||||
|
||||
var __instance.lastIndexOf = String.prototype.lastIndexOf;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__instance.lastIndexOf(true, false) !== 0) {
|
||||
$ERROR('#1: __instance = new Object(true); __instance.lastIndexOf = String.prototype.lastIndexOf; __instance.lastIndexOf(true, false) === 0. Actual: '+__instance.lastIndexOf(true, false) );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue