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
@ -4,37 +4,39 @@
|
|||||||
/**
|
/**
|
||||||
* @name: S12.10_A3.3_T4;
|
* @name: S12.10_A3.3_T4;
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
this.p1 = 1;
|
this.p1 = 1;
|
||||||
|
|
||||||
var result = "result";
|
var result = "result";
|
||||||
|
|
||||||
var myObj = {
|
var myObj = {
|
||||||
p1: 'a',
|
p1: 'a',
|
||||||
value: 'myObj_value',
|
value: 'myObj_value',
|
||||||
valueOf : function(){return 'obj_valueOf';}
|
valueOf : function(){return 'obj_valueOf';}
|
||||||
|
};
|
||||||
|
|
||||||
|
function __FACTORY(){
|
||||||
|
with(myObj){
|
||||||
|
var p1 = 'x1';
|
||||||
|
throw value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
function __FACTORY(){
|
var obj = new __FACTORY();
|
||||||
with(myObj){
|
|
||||||
p1 = 'x1';
|
|
||||||
throw value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var obj = new __FACTORY();
|
|
||||||
} catch(e){
|
} catch(e){
|
||||||
result = p1;
|
result = p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if(result !== 1){
|
if (result !== 1) {
|
||||||
$ERROR('#1: result === 1. Actual: result ==='+ result );
|
$ERROR('#1: result === 1. Actual: result ==='+ result );
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -42,7 +44,7 @@ if(result !== 1){
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
if(p1 !== 1){
|
if (p1 !== 1) {
|
||||||
$ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );
|
$ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -50,7 +52,7 @@ if(p1 !== 1){
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
if(myObj.p1 !== "x1"){
|
if (myObj.p1 !== "x1") {
|
||||||
$ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
|
$ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
* @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',
|
||||||
p2: 'b',
|
p2: 'b',
|
||||||
p3: 'c',
|
p3: 'c',
|
||||||
value: 'myObj_value',
|
value: 'myObj_value',
|
||||||
valueOf : function(){return 'obj_valueOf';},
|
valueOf : function(){return 'obj_valueOf';},
|
||||||
@ -29,7 +30,7 @@ try{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e );
|
if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e );
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK#2
|
// CHECK#2
|
||||||
|
@ -6,11 +6,12 @@
|
|||||||
* @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
|
||||||
try {
|
try {
|
||||||
throw "catchme";
|
throw "catchme";
|
||||||
$ERROR('#1.1: throw "catchme" lead to throwing exception');
|
$ERROR('#1.1: throw "catchme" lead to throwing exception');
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@ -24,7 +25,7 @@ catch (e) {
|
|||||||
|
|
||||||
// CHECK#2
|
// CHECK#2
|
||||||
try {
|
try {
|
||||||
throw "catchme";
|
throw "catchme";
|
||||||
$ERROR('#2.1: throw "catchme" lead to throwing exception');
|
$ERROR('#2.1: throw "catchme" lead to throwing exception');
|
||||||
}
|
}
|
||||||
catch(e){}
|
catch(e){}
|
||||||
|
@ -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,11 +12,11 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$ERROR('#1.1: "__evaluated = eval("if(1);")" does not lead to throwing exception');
|
$ERROR('#1.1: "__evaluated = eval("if(1);")" does not lead to throwing exception');
|
||||||
|
|
||||||
|
@ -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