New Sputnik 'negative' metadata that included exception type was causing problems for SputnikConverter.

Took the easy fix and split the metadata into two: 'negative' and 'errortype'.
This commit is contained in:
David Fugate 2011-06-29 11:11:12 -07:00
parent c52161e734
commit b78c959d2a
135 changed files with 834 additions and 1209 deletions

View File

@ -238,6 +238,7 @@ GlobalScopeTests["S12.14_A16_T6"]={"assertion":"TryStatement: \"try Block Catch\
GlobalScopeTests["S12.14_A16_T7"]={"assertion":"TryStatement: \"try Block Catch\" or \"try Block Finally\" or \"try Block Catch Finally\"","description":"Block: \"{ StatementList }\". Checking if execution of \"try{} catch(){\" fails","id":"S12.14_A16_T7","path":"12_Statement\\12.14_The_try_Statement\\S12.14_A16_T7.js","negative":"."};
GlobalScopeTests["S12.14_A16_T8"]={"assertion":"TryStatement: \"try Block Catch\" or \"try Block Finally\" or \"try Block Catch Finally\"","description":"Block: \"{ StatementList }\". Catch: \"catch (Identifier ) Block\". Checking if execution of \"try{} catch(){finally{}\" fails","id":"S12.14_A16_T8","path":"12_Statement\\12.14_The_try_Statement\\S12.14_A16_T8.js","negative":"."};
GlobalScopeTests["S12.14_A16_T9"]={"assertion":"TryStatement: \"try Block Catch\" or \"try Block Finally\" or \"try Block Catch Finally\"","description":"Checking if execution of \"catch(){} finally{}\" fails","id":"S12.14_A16_T9","path":"12_Statement\\12.14_The_try_Statement\\S12.14_A16_T9.js","negative":"."};
GlobalScopeTests["S12.1_A1"]={"assertion":"The production Block { } in strict code can't contain function declaration","description":"Trying to declare function at the Block statement","id":"S12.1_A1","path":"12_Statement\\12.1_Block\\S12.1_A1.js","negative":"."};
GlobalScopeTests["S12.1_A4_T1"]={"assertion":"The production Block can't be inside of expression","description":"Checking if execution of \"y={__func}()\" fails","id":"S12.1_A4_T1","path":"12_Statement\\12.1_Block\\S12.1_A4_T1.js","negative":"."};
GlobalScopeTests["S12.1_A4_T2"]={"assertion":"The production Block can't be inside of expression","description":"Checking if execution of \"y={x}\" fails","id":"S12.1_A4_T2","path":"12_Statement\\12.1_Block\\S12.1_A4_T2.js","negative":"."};
GlobalScopeTests["S12.2_A8_T1"]={"assertion":"Only AssignmentExpression is admitted when variable is initialized","description":"Checking if execution of \"var x += 1\" fails","id":"S12.2_A8_T1","path":"12_Statement\\12.2_Variable_Statement\\S12.2_A8_T1.js","negative":"."};
@ -254,8 +255,12 @@ GlobalScopeTests["S12.5_A2"]={"assertion":"In the \"if\" Statement eval in Expre
GlobalScopeTests["S12.5_A6_T1"]={"assertion":"In the If statement expression must be enclosed in braces","description":"Checking if execution of \"if true\" fails","id":"S12.5_A6_T1","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A6_T1.js","negative":"."};
GlobalScopeTests["S12.5_A6_T2"]={"assertion":"In the If statement expression must be enclosed in braces","description":"Checking if execution of \"if false\" fails","id":"S12.5_A6_T2","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A6_T2.js","negative":"."};
GlobalScopeTests["S12.5_A8"]={"assertion":"In the \"if\" Statement empty expression is not allowed","description":"Checking if execution of \"if()\" fails","id":"S12.5_A8","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A8.js","negative":"."};
GlobalScopeTests["S12.5_A9_T1"]={"assertion":"Function declaration within an \"if\" statement in strict code is not allowed","description":"Declaring function within an \"if\" statement","id":"S12.5_A9_T1","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A9_T1.js","negative":"."};
GlobalScopeTests["S12.5_A9_T2"]={"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","id":"S12.5_A9_T2","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A9_T2.js","negative":"."};
GlobalScopeTests["S12.5_A9_T3"]={"assertion":"Function declaration within an \"if\" statement is not allowed","description":"Declaring function within an \"if\" statement that is declared within the function declaration","id":"S12.5_A9_T3","path":"12_Statement\\12.5_The_if_Statement\\S12.5_A9_T3.js","negative":"."};
GlobalScopeTests["S12.6.1_A12"]={"assertion":"Any statement within \"do-while\" construction must be a compound","description":"Checking if execution of \"do var x=1; var y =2; while (0)\" fails","id":"S12.6.1_A12","path":"12_Statement\\12.6_Iteration_Statements\\12.6.1_The_do_while_Statement\\S12.6.1_A12.js","negative":"."};
GlobalScopeTests["S12.6.1_A13_T1"]={"assertion":"FunctionDeclaration within a \"do-while\" Block in strict code is not allowed","description":"Declaring function within a \"do-while\" loop","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","negative":"."};
GlobalScopeTests["S12.6.1_A13_T2"]={"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","id":"S12.6.1_A13_T2","path":"12_Statement\\12.6_Iteration_Statements\\12.6.1_The_do_while_Statement\\S12.6.1_A13_T2.js","negative":"."};
GlobalScopeTests["S12.6.1_A13_T3"]={"assertion":"FunctionDeclaration within a \"do-while\" Block is not allowed","description":"Declaring a function within a \"do-while\" loop that is within a function declaration itself","id":"S12.6.1_A13_T3","path":"12_Statement\\12.6_Iteration_Statements\\12.6.1_The_do_while_Statement\\S12.6.1_A13_T3.js","negative":"."};
GlobalScopeTests["S12.6.1_A15"]={"assertion":"Block within a \"do-while\" Expression is not allowed","description":"Using \"{0}\" Block as an Expression","id":"S12.6.1_A15","path":"12_Statement\\12.6_Iteration_Statements\\12.6.1_The_do_while_Statement\\S12.6.1_A15.js","negative":"."};
GlobalScopeTests["S12.6.1_A6_T1"]={"assertion":"Expression in \"do-while\" IterationStatement is bracketed with braces","description":"Checking if execution of \"do{} while 1\" fails","id":"S12.6.1_A6_T1","path":"12_Statement\\12.6_Iteration_Statements\\12.6.1_The_do_while_Statement\\S12.6.1_A6_T1.js","negative":"."};
@ -342,4 +347,20 @@ GlobalScopeTests["S15.2.4.5_A13"]={"assertion":"Let O be the result of calling T
GlobalScopeTests["S15.2.4.6_A12"]={"assertion":"Let O be the result of calling ToObject passing the this value as the argument.","description":"","id":"S15.2.4.6_A12","path":"15_Native\\15.2_Object_Objects\\15.2.4_Properties_of_the_Object_Prototype_Object\\15.2.4.6_Object.prototype.isPrototypeOf\\S15.2.4.6_A12.js","negative":"."};
GlobalScopeTests["S15.2.4.6_A13"]={"assertion":"Let O be the result of calling ToObject passing the this value as the argument.","description":"","id":"S15.2.4.6_A13","path":"15_Native\\15.2_Object_Objects\\15.2.4_Properties_of_the_Object_Prototype_Object\\15.2.4.6_Object.prototype.isPrototypeOf\\S15.2.4.6_A13.js","negative":"."};
GlobalScopeTests["S15.2.4.7_A12"]={"assertion":"Let O be the result of calling ToObject passing the this value as the argument.","description":"","id":"S15.2.4.7_A12","path":"15_Native\\15.2_Object_Objects\\15.2.4_Properties_of_the_Object_Prototype_Object\\15.2.4.7_Object.prototype.propertyIsEnumerable\\S15.2.4.7_A12.js","negative":"."};
GlobalScopeTests["S15.2.4.7_A13"]={"assertion":"Let O be the result of calling ToObject passing the this value as the argument.","description":"","id":"S15.2.4.7_A13","path":"15_Native\\15.2_Object_Objects\\15.2.4_Properties_of_the_Object_Prototype_Object\\15.2.4.7_Object.prototype.propertyIsEnumerable\\S15.2.4.7_A13.js","negative":"."};
GlobalScopeTests["S15.2.4.7_A13"]={"assertion":"Let O be the result of calling ToObject passing the this value as the argument.","description":"","id":"S15.2.4.7_A13","path":"15_Native\\15.2_Object_Objects\\15.2.4_Properties_of_the_Object_Prototype_Object\\15.2.4.7_Object.prototype.propertyIsEnumerable\\S15.2.4.7_A13.js","negative":"."};
GlobalScopeTests["S15.3.4.2_A12"]={"assertion":"The Function.prototype.toString function is not generic; it throws a TypeError exception if its this value is not a Function object.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.2_A13"]={"assertion":"The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.2_A14"]={"assertion":"The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.2_A15"]={"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.","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","negative":"."};
GlobalScopeTests["S15.3.4.2_A16"]={"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.","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","negative":"."};
GlobalScopeTests["S15.3.4.3_A13"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.3_A14"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.3_A15"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.4_A13"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.4_A14"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.4_A15"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.5_A1"]={"assertion":"\"caller\" of bound function is poisoned (step 20)","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.5_A13"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.5_A14"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.5_A15"]={"assertion":"If IsCallable(func) is false, then throw a TypeError exception.","description":"","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","negative":"."};
GlobalScopeTests["S15.3.4.5_A2"]={"assertion":"\"arguments\" of bound function is poisoned (step 21)","description":"","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","negative":"."};

View File

@ -6,7 +6,7 @@
* @section: 7.3;
* @assertion: LINE FEED (U+000A) within strings is not allowed;
* @description: Insert LINE FEED (\u000A) into string;
* @negative
* @negative
*/
// CHECK#1

View File

@ -6,7 +6,7 @@
* @section: 7.3;
* @assertion: CARRIAGE RETURN (U+000D) within strings is not allowed;
* @description: Insert CARRIAGE RETURN (\u000D) into string;
* @negative
* @negative
*/
// CHECK#1

View File

@ -6,7 +6,7 @@
* @section: 7.4;
* @assertion: Multi line comments cannot nest;
* @description: Try use nested comments;
* @negative
* @negative
*/
/*CHECK#1*/

View File

@ -6,7 +6,7 @@
* @section: 7.4;
* @assertion: Single and Multi line comments are used together;
* @description: Try use 2 close comment tags;
* @negative
* @negative
*/
/*CHECK#1*/

View File

@ -6,7 +6,7 @@
* @section: 7.4;
* @assertion: Single and Multi line comments are used together;
* @description: Try to open Multi line comment at the end of Single comment;
* @negative
* @negative
*/
/*CHECK#1*/

View File

@ -6,7 +6,7 @@
* @section: 7.8.5;
* @assertion: RegularExpressionFirstChar :: * or \ or / or [empty] is incorrect;
* @description: /;
* @negative
* @negative
*/
//CHECK#1

View File

@ -6,7 +6,7 @@
* @section: 7.8.5;
* @assertion: RegularExpressionFirstChar :: LineTerminator is incorrect;
* @description: Line Feed, without eval;
* @negative
* @negative
*/
//CHECK#1

View File

@ -6,7 +6,7 @@
* @section: 7.8.5;
* @assertion: RegularExpressionFirstChar :: LineTerminator is incorrect;
* @description: Carriage Return, without eval;
* @negative
* @negative
*/
//CHECK#1

View File

@ -6,7 +6,7 @@
* @section: 7.8.5;
* @assertion: RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect;
* @description: Line Feed, without eval;
* @negative
* @negative
*/
//CHECK#1

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: SyntaxError;
*/
"use strict";

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: SyntaxError;
*/
"use strict";

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: SyntaxError;
*/
(function(){

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: SyntaxError;
*/
"use strict";

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: SyntaxError;
*/
(function(){

View File

@ -5,7 +5,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
Function.prototype.toString.call(undefined);

View File

@ -5,7 +5,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
Function.prototype.toString.call(null);

View File

@ -5,7 +5,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
Function.prototype.toString.call({});

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
Function.prototype.toString.call(/x/);

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
var obj = {toString: Function.prototype.toString};

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.3_A13;
* @section: 15.3.4.3;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.apply.call(undefined, {}, []);

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.3_A14;
* @section: 15.3.4.3;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.apply.call(null, {}, []);

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.3_A15;
* @section: 15.3.4.3;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.apply.call({}, {}, []);

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.4_A13;
* @section: 15.3.4.4;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.call.call(undefined, {});

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.4_A14;
* @section: 15.3.4.4;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.call.call(null, {});

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.4_A15;
* @section: 15.3.4.4;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.call.call({}, {});

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
function foo() { return bar.caller; }

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.5_A13;
* @section: 15.3.4.5;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.bind.call(undefined, {});

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.5_A14;
* @section: 15.3.4.5;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.bind.call(null, {});

View File

@ -5,7 +5,8 @@
* @name: S15.3.4.5_A15;
* @section: 15.3.4.5;
* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
* @negative TypeError;
* @negative
* @errortype: TypeError;
*/
Function.prototype.bind.call({}, {});

View File

@ -6,7 +6,8 @@
* @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;
* @negative
* @errortype: TypeError;
*/
function foo() { return bar.arguments; }

View File

@ -1,34 +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.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;
*/
// 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
ES5Harness.registerTest( {
id: "S12.1_A1",
path: "TestCases/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(){}
}
}
});
"use strict";
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
{
function __func(){}
}

View File

@ -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 {
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');
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//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');
}
//
//////////////////////////////////////////////////////////////////////////////
}
});

View File

@ -1,36 +1,16 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S12.5_A9_T1",
path: "TestCases/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(){};
}
}
});
"use strict";
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
if (true) {
function __func(){};
} else {
function __func(){};
}

View File

@ -1,38 +1,18 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S12.5_A9_T2",
path: "TestCases/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(){};
}
});
}
});
(function(){
"use strict";
if (true) {
function __func(){};
} else {
function __func(){};
}
});

View File

@ -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,37 +21,37 @@ assertion: "When the production \"do Statement while ( Expression )\" is evaluat
description: "Evaluating various Expressions",
test: function testcase() {
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');
}
//
//////////////////////////////////////////////////////////////////////////////
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');
}
//
//////////////////////////////////////////////////////////////////////////////
}
});

View File

@ -1,34 +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.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;
*/
// 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
ES5Harness.registerTest( {
id: "S12.6.1_A13_T1",
path: "TestCases/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);
}
});
"use strict";
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
do{
function __func(){};
} while(0);

View File

@ -1,35 +1,15 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S12.6.1_A13_T2",
path: "TestCases/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);
});
}
});
(function(){
"use strict";
do{
function __func(){};
}while(0);
});

View File

@ -5,7 +5,7 @@
* @name: S15.10.2.7_A4_T2;
* @section: 15.10.2.7;
* @assertion: The production QuantifierPrefix :: * evaluates by returning the two results 0 and \infty;
* @description: Execute /[^"S15.10.2.7_A4_T2"don\'t"') and check results;
* @description: Execute /[^"]* /.exec('alice said: "don\'t"') and check results;
*/

View File

@ -1,13 +1,13 @@
// 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;
*/
// 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
@ -21,14 +21,14 @@ 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"');
}
(/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"');
}
}
});

View File

@ -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: S15.10.6.2_A1_T1;
* @section: 15.10.6.2;
* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and
* returns an Array object containing the results of the match, or null if the string did not match;
* @description: String is "123" and RegExp is /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.10.6.2_A1_T1;
* @section: 15.10.6.2;
* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and
* returns an Array object containing the results of the match, or null if the string did not match;
* @description: String is "123" and RegExp is /1|12/;
*/
// Converted for Test262 from original Sputnik source
@ -22,38 +22,38 @@ assertion: "RegExp.prototype.exec(string) Performs a regular expression match of
description: "String is \"123\" and RegExp is /1|12/",
test: function testcase() {
__executed = /1|12/.exec("123");
__expected = ["1"];
__expected.index=0;
__expected.input="123";
//CHECK#0
if ((__executed instanceof Array) !== true) {
$ERROR('#0: __executed = /1|12/.exec("123"); (__executed instanceof Array) === true');
}
//CHECK#1
if (__executed.length !== __expected.length) {
$ERROR('#1: __executed = /1|12/.exec("123"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
}
//CHECK#2
if (__executed.index !== __expected.index) {
$ERROR('#2: __executed = /1|12/.exec("123"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
}
//CHECK#3
if (__executed.input !== __expected.input) {
$ERROR('#3: __executed = /1|12/.exec("123"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
}
//CHECK#4
for(var index=0; index<__expected.length; index++) {
if (__executed[index] !== __expected[index]) {
$ERROR('#4: __executed = /1|12/.exec("123"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
}
}
__executed = /1|12/.exec("123");
__expected = ["1"];
__expected.index=0;
__expected.input="123";
//CHECK#0
if ((__executed instanceof Array) !== true) {
$ERROR('#0: __executed = /1|12/.exec("123"); (__executed instanceof Array) === true');
}
//CHECK#1
if (__executed.length !== __expected.length) {
$ERROR('#1: __executed = /1|12/.exec("123"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
}
//CHECK#2
if (__executed.index !== __expected.index) {
$ERROR('#2: __executed = /1|12/.exec("123"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
}
//CHECK#3
if (__executed.input !== __expected.input) {
$ERROR('#3: __executed = /1|12/.exec("123"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
}
//CHECK#4
for(var index=0; index<__expected.length; index++) {
if (__executed[index] !== __expected[index]) {
$ERROR('#4: __executed = /1|12/.exec("123"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
}
}
}
});

View File

@ -1,13 +1,13 @@
// 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;
*/
// 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
@ -21,13 +21,13 @@ 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');
}
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');
}
}
});

View File

@ -1,12 +1,12 @@
// 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]".
*/
// 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
@ -20,9 +20,9 @@ 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]".');
}
if (Object.prototype.toString.call(undefined) !== "[object Undefined]") {
$ERROR('If the this value is undefined, return "[object Undefined]".');
}
}
});

View File

@ -1,12 +1,12 @@
// 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]".
*/
// 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
@ -20,9 +20,9 @@ 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]".');
}
if (Object.prototype.toString.call(null) !== "[object Null]") {
$ERROR('If the this value is null, return "[object Null]".');
}
}
});

View File

@ -1,12 +1,12 @@
// 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.
*/
// 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
@ -20,10 +20,10 @@ assertion: "Let O be the result of calling ToObject passing the this value as th
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.');
}
if (Object.prototype.toString.call(33) !== "[object Number]") {
$ERROR('Let O be the result of calling ToObject passing the this ' +
'value as the argument.');
}
}
});

View File

@ -1,12 +1,12 @@
// 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.
*/
// 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
@ -20,10 +20,10 @@ assertion: "Let O be the result of calling ToObject passing the this value as th
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.');
}
if (Object.prototype.toString.call(true) !== "[object Boolean]") {
$ERROR('Let O be the result of calling ToObject passing the this ' +
'value as the argument.');
}
}
});

View File

@ -1,12 +1,12 @@
// 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.
*/
// 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
@ -20,10 +20,10 @@ assertion: "Let O be the result of calling ToObject passing the this value as th
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.');
}
if (Object.prototype.toString.call('foo') !== "[object String]") {
$ERROR('Let O be the result of calling ToObject passing the this ' +
'value as the argument.');
}
}
});

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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);
Object.prototype.toLocaleString.call(undefined);

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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);
Object.prototype.toLocaleString.call(null);

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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);
Object.prototype.valueOf.call(undefined);

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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);
Object.prototype.valueOf.call(null);

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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)();
(1,Object.prototype.valueOf)();

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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');
Object.prototype.hasOwnProperty.call(undefined, 'foo');

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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');
Object.prototype.hasOwnProperty.call(null, 'foo');

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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, {});
Object.prototype.isPrototypeOf.call(undefined, {});

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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, {});
Object.prototype.isPrototypeOf.call(null, {});

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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');
Object.prototype.propertyIsEnumerable.call(undefined, 'foo');

View File

@ -1,9 +1,9 @@
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// 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');
Object.prototype.propertyIsEnumerable.call(null, 'foo');

View File

@ -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.');
}
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.');
}
//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.');
}
}
});

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.2_A12",
path: "TestCases/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);
}
});
Function.prototype.toString.call(undefined);

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.2_A13",
path: "TestCases/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);
}
});
Function.prototype.toString.call(null);

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.2_A14",
path: "TestCases/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({});
}
});
Function.prototype.toString.call({});

View File

@ -1,29 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.2_A15",
path: "TestCases/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/);
}
});
Function.prototype.toString.call(/x/);

View File

@ -1,31 +1,11 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.2_A16",
path: "TestCases/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);
}
});
var obj = {toString: Function.prototype.toString};
String(obj);

View File

@ -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() {
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');
}
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');
}
}
});

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.3_A13",
path: "TestCases/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, {}, []);
}
});
Function.prototype.apply.call(undefined, {}, []);

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.3_A14",
path: "TestCases/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, {}, []);
}
});
Function.prototype.apply.call(null, {}, []);

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.3_A15",
path: "TestCases/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({}, {}, []);
}
});
Function.prototype.apply.call({}, {}, []);

View File

@ -1,13 +1,13 @@
// 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.
*/
// 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
@ -21,20 +21,20 @@ 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);
}
}
}
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);
}
}
}
}
});

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.4_A13",
path: "TestCases/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, {});
}
});
Function.prototype.call.call(undefined, {});

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.4_A14",
path: "TestCases/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, {});
}
});
Function.prototype.call.call(null, {});

View File

@ -1,28 +1,9 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.4_A15",
path: "TestCases/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({}, {});
}
});
Function.prototype.call.call({}, {});

View File

@ -1,13 +1,13 @@
// 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.
*/
// 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
@ -21,20 +21,20 @@ 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);
}
}
}
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);
}
}
}
}
});

View File

@ -1,32 +1,12 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.5_A1",
path: "TestCases/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();
}
});
function foo() { return bar.caller; }
var bar = foo.bind({});
function baz() { return bar(); }
baz();

View File

@ -1,29 +1,10 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.5_A13",
path: "TestCases/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, {});
}
});
Function.prototype.bind.call(undefined, {});

View File

@ -1,29 +1,10 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.5_A14",
path: "TestCases/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, {});
}
});
Function.prototype.bind.call(null, {});

View File

@ -1,29 +1,10 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.5_A15",
path: "TestCases/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({}, {});
}
});
Function.prototype.bind.call({}, {});

View File

@ -1,13 +1,13 @@
// 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.
*/
// 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
@ -21,20 +21,20 @@ 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);
}
}
}
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);
}
}
}
}
});

View File

@ -1,32 +1,12 @@
// 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;
*/
// 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
ES5Harness.registerTest( {
id: "S15.3.4.5_A2",
path: "TestCases/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();
}
});
function foo() { return bar.arguments; }
var bar = foo.bind({});
function baz() { return bar(); }
baz();

View File

@ -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_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]]+];
*/
// 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
@ -21,10 +21,10 @@ assertion: "The Function prototype object is itself a Function object (its [[Cla
description: "Object.prototype.toString returns [object+[[Class]]+]",
test: function testcase() {
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)');
}
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)');
}
}
});

View File

@ -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;
* @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;
*/
// 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
@ -21,11 +21,11 @@ assertion: "The value of the internal [[Prototype]] property of the Function pro
description: "Checking prototype of Function.prototype",
test: function testcase() {
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)');
}
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)');
}
}
});

View File

@ -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');
}
}
});

View File

@ -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_A1_T1;
* @section: 15.3.5;
* @assertion: The value of the [[Class]] property is "Function";
* @description: 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
@ -21,11 +21,11 @@ assertion: "The value of the [[Class]] property is \"Function\"",
description: "For testing use variable f = new Function",
test: function testcase() {
var f = new Function;
if (Object.prototype.toString.call(f) !== "[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"');
}
}
});

View File

@ -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_A1_T2;
* @section: 15.3.5;
* @assertion: The value of the [[Class]] property is "Function" ;
* @description: 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
@ -21,12 +21,12 @@ assertion: "The value of the [[Class]] property is \"Function\"",
description: "For testing use variable f = Function()",
test: function testcase() {
var f = Function();
if (Object.prototype.toString.call(f) !== "[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"');
}
}
});

View File

@ -1,13 +1,13 @@
// 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;
*/
// 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
@ -21,19 +21,19 @@ 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;
});
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;
});
}
});

View File

@ -1,13 +1,13 @@
// 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
*/
// 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
@ -21,7 +21,7 @@ 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); });
['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
}
});

View File

@ -1,13 +1,13 @@
// 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
*/
// 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
@ -21,10 +21,10 @@ 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();
function foo() {
['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
}
foo();
}
});

View File

@ -1,12 +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;
* @assertion:The Array prototype object is itself an array; its [[Class]] is "Array",
*/
// 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
@ -20,11 +20,11 @@ assertion: "The Array prototype object is itself an array; its [[Class]] is \"Ar
description: "",
test: function testcase() {
//CHECK#1
if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") {
$ERROR('The Array prototype object is itself an array; its' +
'[[Class]] is "Array".');
}
//CHECK#1
if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") {
$ERROR('The Array prototype object is itself an array; its' +
'[[Class]] is "Array".');
}
}
});

View File

@ -1,13 +1,13 @@
// 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;
*/
// 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
@ -21,19 +21,19 @@ 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';
});
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';
});
}
});

View File

@ -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,17 +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);
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) );
}
//
//////////////////////////////////////////////////////////////////////////////
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) );
}
//
//////////////////////////////////////////////////////////////////////////////
}
});

View File

@ -69,7 +69,7 @@ namespace Microsoft.Sputnik.Interop.ParserEngine
Console.WriteLine();
}
string[] args = { script.Header, script.id, script.path, InsertStringEscapes(script.assertion), InsertStringEscapes(script.description), script.ReplicationCode, body, preCondition, script.InitialComment };
string[] args = { script.Header, script.id, script.path.Replace("\\", "/"), InsertStringEscapes(script.assertion), InsertStringEscapes(script.description), script.ReplicationCode, body, preCondition, script.InitialComment };
destFullPath = Path.Combine(destDir, string.Format(@"{0}.js", script.id));
try

View File

@ -14,6 +14,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartArguments>E:\test262-msft\test\suite\sputnik\conformance E:\test262-msft\test\suite\sputnik_new01</StartArguments>
<StartArguments>G:\262\test262\test\suite\sputnik\conformance G:\262\test262\test\suite\sputnik_new01</StartArguments>
</PropertyGroup>
</Project>

View File

@ -15,6 +15,7 @@ namespace Microsoft.Sputnik.Interop.ParserEngine
if (args == null || args.Length < 2)
{
System.Console.WriteLine("You must specify the source directory and the destination directory!");
return;
}
source = args[0];

View File

@ -4,7 +4,7 @@
ES5Harness.registerTest( {{
id: "{1}",
path: "{2}",
path: "TestCases/{2}",
description: "{4}",

View File

@ -4,7 +4,7 @@
ES5Harness.registerTest( {{
id: "{1}",
path: "{2}",
path: "TestCases/{2}",
assertion: "{3}",

View File

@ -4,7 +4,7 @@
ES5Harness.registerTest( {{
id: "{1}",
path: "{2}",
path: "TestCases/{2}",
assertion: "{3}",

View File

@ -4,7 +4,7 @@
ES5Harness.registerTest( {{
id: "{1}",
path: "{2}",
path: "TestCases/{2}",
description: "{4}",

View File

@ -4,7 +4,7 @@
ES5Harness.registerTest( {{
id: "{1}",
path: "{2}",
path: "TestCases/{2}",
assertion: "{3}",

Some files were not shown because too many files have changed in this diff Show More