mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 496923 - Import the ch14 tests from test262. r=generating-script-was-reviewed
--HG-- extra : rebase_source : 7146eb81941b66910c45fcc2491c2c2be28a597c
This commit is contained in:
parent
1c925b908b
commit
1d8fb877a4
35
js/src/tests/test262/ch14/14.0/S14_A1.js
Normal file
35
js/src/tests/test262/ch14/14.0/S14_A1.js
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* FunctionExpression must be localed in a reacheable fragment of the program
|
||||
*
|
||||
* @path ch14/14.0/S14_A1.js
|
||||
* @description Declaring a function within an "if" Expression
|
||||
*/
|
||||
|
||||
var THERE = "I'm there";
|
||||
var HERE = "I'm here";
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if ( __func !== undefined) {
|
||||
$ERROR('#1: __func === undefined. Actual: __func ==='+ __func );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (true){
|
||||
var __func = function(){return HERE;};
|
||||
} else {
|
||||
var __func = function (){return THERE;};
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (__func() !== HERE) {
|
||||
$ERROR('#2: __func() === HERE. Actual: __func() ==='+ __func() );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
31
js/src/tests/test262/ch14/14.0/S14_A2.js
Normal file
31
js/src/tests/test262/ch14/14.0/S14_A2.js
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* FunctionDeclaration cannot be localed inside an Expression
|
||||
*
|
||||
* @path ch14/14.0/S14_A2.js
|
||||
* @description Declaring a function within an "if" Expression
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (typeof f !== 'undefined') {
|
||||
$ERROR('#1: typeof f === \'undefined\'. Actual: typeof f ==='+ typeof f );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (function f(arg){
|
||||
if (arg===0)
|
||||
return 1;
|
||||
else
|
||||
return f(arg-1)*arg;
|
||||
}(3)!==6) {
|
||||
$ERROR('#2: FunctionDeclaration cannot be localed inside an Expression');
|
||||
};
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
30
js/src/tests/test262/ch14/14.0/S14_A3.js
Normal file
30
js/src/tests/test262/ch14/14.0/S14_A3.js
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* Global FunctionDeclaration cannot be defined within the body of another FunctionDeclaration
|
||||
*
|
||||
* @path ch14/14.0/S14_A3.js
|
||||
* @description Declaring a function within the body of another function
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (typeof __func !== "function") {
|
||||
$ERROR('#1: typeof __func === "function". Actual: typeof __func ==='+ typeof __func );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#2
|
||||
if (typeof __gunc !== "undefined") {
|
||||
$ERROR('#2: typeof __gunc === "undefined". Actual: typeof __gunc ==='+ typeof __gunc );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function __func(){
|
||||
function __gunc(){return true};
|
||||
}
|
||||
|
22
js/src/tests/test262/ch14/14.0/S14_A5_T1.js
Normal file
22
js/src/tests/test262/ch14/14.0/S14_A5_T1.js
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* The Identifer within a FunctionDeclaration can be written in both letters and unicode
|
||||
*
|
||||
* @path ch14/14.0/S14_A5_T1.js
|
||||
* @description Declaring a function with "function __\u0066\u0075\u006e\u0063(){return "both"}"
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__func() !== "both") {
|
||||
$ERROR('#1: __func() === "both". Actual: __func() ==='+ __func() );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function __func(){return "ascii"};
|
||||
function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode
|
||||
function __\u0066\u0075\u006e\u0063(){return "both"};//__func in unicode
|
||||
|
21
js/src/tests/test262/ch14/14.0/S14_A5_T2.js
Normal file
21
js/src/tests/test262/ch14/14.0/S14_A5_T2.js
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* The Identifer within a FunctionDeclaration can be written in both letters and unicode
|
||||
*
|
||||
* @path ch14/14.0/S14_A5_T2.js
|
||||
* @description Declaring a function with "function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"}"
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
if (__func() !== "unicode") {
|
||||
$ERROR('#1: __func() === "unicode". Actual: __func() ==='+ __func() );
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function __func(){return "ascii"};
|
||||
function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode
|
||||
|
0
js/src/tests/test262/ch14/14.0/browser.js
Normal file
0
js/src/tests/test262/ch14/14.0/browser.js
Normal file
0
js/src/tests/test262/ch14/14.0/shell.js
Normal file
0
js/src/tests/test262/ch14/14.0/shell.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-1-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-1-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-1-s.js
|
||||
* @description 'use strict' directive - correct usage
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
return(this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-10-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-10-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-10-s.js
|
||||
* @description other directives - may follow 'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"use strict";
|
||||
"bogus directive";
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
26
js/src/tests/test262/ch14/14.1/14.1-11-s.js
Normal file
26
js/src/tests/test262/ch14/14.1/14.1-11-s.js
Normal file
@ -0,0 +1,26 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-11-s.js
|
||||
* @description comments may preceed 'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
// comment
|
||||
/* comment */ "use strict";
|
||||
|
||||
return(this === undefined);
|
||||
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-12-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-12-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-12-s.js
|
||||
* @description comments may follow 'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"use strict"; /* comment */ // comment
|
||||
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-13-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-13-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-13-s.js
|
||||
* @description semicolon insertion works for'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"use strict"
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-14-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-14-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-14-s.js
|
||||
* @description semicolon insertion may come before 'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"another directive"
|
||||
"use strict" ;
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
29
js/src/tests/test262/ch14/14.1/14.1-15-s.js
Normal file
29
js/src/tests/test262/ch14/14.1/14.1-15-s.js
Normal file
@ -0,0 +1,29 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-15-s.js
|
||||
* @description blank lines may come before 'use strict' directive
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"use strict" ;
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-16-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-16-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-16-s.js
|
||||
* @description 'use strict' directive - not recognized if it follow an empty statement
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
; 'use strict';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-17-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-17-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-17-s.js
|
||||
* @description 'use strict' directive - not recognized if it follow some other statment empty statement
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
var x;
|
||||
'use strict';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-2-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-2-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-2-s.js
|
||||
* @description "use strict" directive - correct usage double quotes
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"use strict";
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-3-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-3-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-3-s.js
|
||||
* @description 'use strict' directive - not recognized if it contains extra whitespace
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
' use strict ';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-4-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-4-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-4-s.js
|
||||
* @description 'use strict' directive - not recognized if contains Line Continuation
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use str\
|
||||
ict';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
14
js/src/tests/test262/ch14/14.1/14.1-4gs.js
Normal file
14
js/src/tests/test262/ch14/14.1/14.1-4gs.js
Normal file
@ -0,0 +1,14 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-4gs.js
|
||||
* @description StrictMode - a Use Strict Directive followed by a strict mode violation
|
||||
* @onlyStrict
|
||||
* @negative ^((?!NotEarlyError).)*$
|
||||
*/
|
||||
"use strict";
|
||||
throw NotEarlyError;
|
||||
eval = 42;
|
23
js/src/tests/test262/ch14/14.1/14.1-5-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-5-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-5-s.js
|
||||
* @description 'use strict' directive - not recognized if contains a EscapeSequence
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use\u0020strict';
|
||||
return(this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
16
js/src/tests/test262/ch14/14.1/14.1-5gs.js
Normal file
16
js/src/tests/test262/ch14/14.1/14.1-5gs.js
Normal file
@ -0,0 +1,16 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-5gs.js
|
||||
* @description StrictMode - a Use Strict Directive embedded in a directive prologue followed by a strict mode violation
|
||||
* @onlyStrict
|
||||
* @negative ^((?!NotEarlyError).)*$
|
||||
*/
|
||||
"a";
|
||||
"use strict";
|
||||
"c";
|
||||
throw NotEarlyError;
|
||||
eval = 42;
|
23
js/src/tests/test262/ch14/14.1/14.1-6-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-6-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-6-s.js
|
||||
* @description 'use strict' directive - not recognized if contains a <TAB> instead of a space
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
23
js/src/tests/test262/ch14/14.1/14.1-7-s.js
Normal file
23
js/src/tests/test262/ch14/14.1/14.1-7-s.js
Normal file
@ -0,0 +1,23 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-7-s.js
|
||||
* @description 'use strict' directive - not recognized if upper case
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'Use Strict';
|
||||
return (this !== undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-8-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-8-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-8-s.js
|
||||
* @description 'use strict' directive - may follow other directives
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
"bogus directive";
|
||||
"use strict";
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
24
js/src/tests/test262/ch14/14.1/14.1-9-s.js
Normal file
24
js/src/tests/test262/ch14/14.1/14.1-9-s.js
Normal file
@ -0,0 +1,24 @@
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch14/14.1/14.1-9-s.js
|
||||
* @description 'use strict' directive - may occur multiple times
|
||||
* @noStrict
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo()
|
||||
{
|
||||
'use strict';
|
||||
"use strict";
|
||||
return (this === undefined);
|
||||
}
|
||||
|
||||
return foo.call(undefined);
|
||||
}
|
||||
runTestCase(testcase);
|
0
js/src/tests/test262/ch14/14.1/browser.js
Normal file
0
js/src/tests/test262/ch14/14.1/browser.js
Normal file
0
js/src/tests/test262/ch14/14.1/shell.js
Normal file
0
js/src/tests/test262/ch14/14.1/shell.js
Normal file
0
js/src/tests/test262/ch14/browser.js
Normal file
0
js/src/tests/test262/ch14/browser.js
Normal file
0
js/src/tests/test262/ch14/shell.js
Normal file
0
js/src/tests/test262/ch14/shell.js
Normal file
Loading…
Reference in New Issue
Block a user