mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 08:24:23 +02:00
Updating Google contribution to r97 of sputniktests.
This commit is contained in:
parent
02e7fb9cfa
commit
a230618291
@ -6,7 +6,8 @@
|
|||||||
* @section: 12.10;
|
* @section: 12.10;
|
||||||
* @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;
|
* the scope chain is always restored to its former state;
|
||||||
* @description: Declaring "with" statement within a function constructor, leading to completion by exception;
|
* @description: Declaring "with" statement within a function
|
||||||
|
* constructor, leading to completion by exception;
|
||||||
* @strict_mode_negative
|
* @strict_mode_negative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -18,15 +19,16 @@ var myObj = {
|
|||||||
p1: 'a',
|
p1: 'a',
|
||||||
value: 'myObj_value',
|
value: 'myObj_value',
|
||||||
valueOf : function(){return 'obj_valueOf';}
|
valueOf : function(){return 'obj_valueOf';}
|
||||||
}
|
};
|
||||||
|
|
||||||
try {
|
|
||||||
function __FACTORY(){
|
function __FACTORY(){
|
||||||
with(myObj){
|
with(myObj){
|
||||||
p1 = 'x1';
|
var p1 = 'x1';
|
||||||
throw value;
|
throw value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
var obj = new __FACTORY();
|
var obj = new __FACTORY();
|
||||||
} catch(e){
|
} catch(e){
|
||||||
result = p1;
|
result = p1;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* @section: 12.14;
|
* @section: 12.14;
|
||||||
* @assertion: Using "try" with "catch" or "finally" statement within/without a "with" statement;
|
* @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;
|
* @description: Using try/catch/finally in With and With in try/catch/finally;
|
||||||
|
* @strict_mode_negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var myObj = {p1: 'a',
|
var myObj = {p1: 'a',
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* @section: 12.14;
|
* @section: 12.14;
|
||||||
* @assertion: Sanity test for "catch(Indetifier) statement";
|
* @assertion: Sanity test for "catch(Indetifier) statement";
|
||||||
* @description: Checking if deleting an exception fails;
|
* @description: Checking if deleting an exception fails;
|
||||||
|
* @strict_mode_negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
|
@ -4,10 +4,15 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.1_A1;
|
* @name: S12.1_A1;
|
||||||
* @section: 12.1;
|
* @section: 12.1;
|
||||||
* @assertion: The production Block { } can't contain function declaration;
|
* @assertion: The production Block { } in strict code can't contain
|
||||||
|
* function declaration;
|
||||||
* @description: Trying to declare function at the Block statement;
|
* @description: Trying to declare function at the Block statement;
|
||||||
* @negative;
|
* @negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||||
|
|
||||||
{
|
{
|
||||||
function __func(){}
|
function __func(){}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
try {
|
try {
|
||||||
__evaluated = eval("if(1);");
|
var __evaluated = eval("if(1);");
|
||||||
if (__evaluated !== undefined) {
|
if (__evaluated !== undefined) {
|
||||||
$ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );
|
$ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,15 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.5_A9_T1;
|
* @name: S12.5_A9_T1;
|
||||||
* @section: 12.5;
|
* @section: 12.5;
|
||||||
* @assertion: Function declaration within an "if" statement is not allowed;
|
* @assertion: Function declaration within an "if" statement in strict
|
||||||
|
* code is not allowed;
|
||||||
* @description: Declaring function within an "if" statement;
|
* @description: Declaring function within an "if" statement;
|
||||||
* @negative;
|
* @negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,12 +4,15 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.5_A9_T2;
|
* @name: S12.5_A9_T2;
|
||||||
* @section: 12.5;
|
* @section: 12.5;
|
||||||
* @assertion: Function declaration within an "if" statement is not allowed;
|
* @assertion: Function declaration within an "if" statement in strict
|
||||||
* @description: Declaring function within and "if" that is declared within the function call;
|
* code is not allowed;
|
||||||
* @negative;
|
* @description: Declaring function within an "if" that is declared
|
||||||
|
* within the strict function;
|
||||||
|
* @negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
@ -17,4 +20,4 @@ if (true) {
|
|||||||
function __func(){};
|
function __func(){};
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
});
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
* @description: Evaluating various Expressions;
|
* @description: Evaluating various Expressions;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var __in__do;
|
||||||
|
|
||||||
do __in__do=1; while ( false );
|
do __in__do=1; while ( false );
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -4,11 +4,15 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.6.1_A13_T1;
|
* @name: S12.6.1_A13_T1;
|
||||||
* @section: 12.6.1, 13;
|
* @section: 12.6.1, 13;
|
||||||
* @assertion: FunctionDeclaration within a "do-while" Block is not allowed;
|
* @assertion: FunctionDeclaration within a "do-while" Block in strict
|
||||||
|
* code is not allowed;
|
||||||
* @description: Declaring function within a "do-while" loop;
|
* @description: Declaring function within a "do-while" loop;
|
||||||
* @negative;
|
* @negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
if (!strict_mode) { throw new SyntaxError('unspecified case'); }
|
||||||
|
|
||||||
do{
|
do{
|
||||||
function __func(){};
|
function __func(){};
|
||||||
} while(0);
|
} while(0);
|
||||||
|
@ -4,15 +4,17 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.6.1_A13_T2;
|
* @name: S12.6.1_A13_T2;
|
||||||
* @section: 12.6.1, 13;
|
* @section: 12.6.1, 13;
|
||||||
* @assertion: FunctionDeclaration within a "do-while" Block is not allowed;
|
* @assertion: FunctionDeclaration within a "do-while" Block in strict
|
||||||
* @description: Declaring a function within a "do-while" loop that is within a function call;
|
* code is not allowed;
|
||||||
* @negative;
|
* @description: Declaring a function within a "do-while" loop that is
|
||||||
|
* within a strict function;
|
||||||
|
* @negative SyntaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
"use strict";
|
||||||
do{
|
do{
|
||||||
function __func(){};
|
function __func(){};
|
||||||
}while(0);
|
}while(0);
|
||||||
|
|
||||||
})();
|
});
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
* @negative
|
* @negative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Object.prototype.toLocaleString.call(undefined);
|
Object.prototype.valueOf.call(undefined);
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
* @negative
|
* @negative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Object.prototype.toLocaleString.call(null);
|
Object.prototype.valueOf.call(null);
|
||||||
|
@ -13,7 +13,7 @@ if (!(Function.prototype.toString.hasOwnProperty('length'))) {
|
|||||||
$FAIL('#1: the Function.prototype.toString has length property.');
|
$FAIL('#1: the Function.prototype.toString has length property.');
|
||||||
}
|
}
|
||||||
|
|
||||||
obj = Function.prototype.toString.length;
|
var obj = Function.prototype.toString.length;
|
||||||
|
|
||||||
Function.prototype.toString.length = function(){return "shifted";};
|
Function.prototype.toString.length = function(){return "shifted";};
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* @description: For testing use Function.prototype.toString() function;
|
* @description: For testing use Function.prototype.toString() function;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
f = function(x) {
|
var f = function(x) {
|
||||||
return x*x;
|
return x*x;
|
||||||
}
|
};
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (eval(f.toString())(10) !== f(10)) {
|
if (eval(f.toString())(10) !== f(10)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user