mirror of https://github.com/tc39/test262.git
Regenerating converted files post-merge
This commit is contained in:
parent
fc18852cda
commit
d403f61b52
|
@ -11,8 +11,9 @@
|
|||
* @description Returning number. Declaring a function with "function __func()"
|
||||
*/
|
||||
|
||||
var x;
|
||||
function __func(){
|
||||
var x = 1;
|
||||
x = 1;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
@ -28,7 +29,7 @@ try {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CHECK#1
|
||||
try{
|
||||
var __x=__func()
|
||||
var __x=__func();
|
||||
} catch(e){
|
||||
$ERROR('#1: var __x=__func() does not lead to throwing exception. Actual: exception is '+e);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
function testcase() {
|
||||
eval("var test\u2028prop = 66;");
|
||||
return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined";
|
||||
eval("var test7_3_1\u2028prop = 66;");
|
||||
return (prop === 66) && ((typeof test7_3_1) === "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
function testcase() {
|
||||
eval("var test\u2029prop = 66;");
|
||||
return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined";
|
||||
eval("var test7_3_2\u2029prop = 66;");
|
||||
return (prop===66) && ((typeof test7_3_2) === "undefined");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter07/7.6/7.6.1/7.6.1.2-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
var implements = 1;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter07/7.8/7.8.3/7.8.3-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
var y = 010;
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter07/7.8/7.8.5/7.8.5-1gs.js
|
||||
*/
|
||||
|
||||
throw NotEarlyError;
|
||||
var re = //;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter07/7.8/7.8.5/7.8.5-2gs.js
|
||||
*/
|
||||
|
||||
var re = new RegExp("");
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter08/8.7/8.7.2/8.7.2-3-a-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
b = 11;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter08/8.7/8.7.2/8.7.2-3-a-2gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
b = 11;
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.1/10.1.1/10.1.1-2gs.js
|
||||
*/
|
||||
|
||||
"use strict"
|
||||
throw NotEarlyError;
|
||||
var public = 1;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.1/10.1.1/10.1.1-5gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
var public = 1;
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.1/10.1.1/10.1.1-8gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
throw NotEarlyError;
|
||||
var public = 1;
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.4/10.4.2/10.4.2.1-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
eval("var x = 7;");
|
||||
x = 9;
|
||||
throw NotEarlyError;
|
|
@ -0,0 +1,35 @@
|
|||
/// Copyright (c) 2011 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter10/10.4/10.4.3/10.4.3-1-7-s.js
|
||||
* @description Strict Mode - checking 'this' (FunctionDeclaration defined within strict mode)
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
"use strict";
|
||||
function f() {
|
||||
return typeof this;
|
||||
}
|
||||
return f() === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,32 @@
|
|||
/// Copyright (c) 2011 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter10/10.4/10.4.3/10.4.3-1-7gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function f() {
|
||||
return typeof this;
|
||||
}
|
||||
if (f() !== "undefined") {
|
||||
throw "'this' had incorrect value!";
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/// Copyright (c) 2011 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter10/10.4/10.4.3/10.4.3-1-8-s.js
|
||||
* @description Strict Mode - checking 'this' (FunctionDeclaration includes strict directive prologue)
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
function f() {
|
||||
"use strict";
|
||||
return typeof this;
|
||||
}
|
||||
return f() === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,31 @@
|
|||
/// Copyright (c) 2011 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter10/10.4/10.4.3/10.4.3-1-8gs.js
|
||||
*/
|
||||
|
||||
function f() {
|
||||
"use strict";
|
||||
return typeof this;
|
||||
}
|
||||
if (f() !== "undefined") {
|
||||
throw "'this' had incorrect value!";
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.5/10.5-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
|
||||
function f_10_5_1_gs(){
|
||||
arguments = 7;
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
/**
|
||||
* @path chapter10/10.5/10.5-7-b-2-s.js
|
||||
* @description Strict Mode - arguments object index assignment is disallowed
|
||||
* @description Strict Mode - arguments object index assignment is allowed
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.6/10.6-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function f_10_6_1_gs(){
|
||||
return arguments.callee;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter10/10.6/10.6-2gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function f_10_6_1_gs(){
|
||||
return arguments.callee;
|
||||
}
|
||||
f_10_6_1_gs();
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter11/11.1/11.1.1/11.1.1-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
if (this===undefined) {
|
||||
throw NotEarlyError;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter11/11.13/11.13.2/11.13.2-6-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
eval *= 20;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter11/11.3/11.3.1/11.3.1-2-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
arguments++;
|
|
@ -0,0 +1,34 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.3/11.3.1/11.3.1-2-3-s.js
|
||||
* @description Strict Mode - SyntaxError is not thrown if the identifier 'arguments[...]' appears as a PostfixExpression(arguments++)
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
"use strict";
|
||||
arguments[1] = 7;
|
||||
arguments[1]++;
|
||||
return arguments[1]===8;
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,34 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.3/11.3.2/11.3.2-2-3-s.js
|
||||
* @description Strict Mode - SyntaxError is not thrown if the identifier 'arguments[...]' appears as a PostfixExpression(arguments--)
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
"use strict";
|
||||
arguments[1] = 7;
|
||||
arguments[1]--;
|
||||
return arguments[1]===6;
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,34 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.4/11.4.4/11.4.4-2-3-s.js
|
||||
* @description Strict Mode - SyntaxError is not thrown for ++arguments[...]
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
"use strict";
|
||||
arguments[1] = 7;
|
||||
++arguments[1];
|
||||
return arguments[1]===8;
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter11/11.4/11.4.5/11.4.5-2-2gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
--arguments;
|
|
@ -0,0 +1,34 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.4/11.4.5/11.4.5-2-3-s.js
|
||||
* @description Strict Mode - SyntaxError is not thrown for --arguments[...]
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
"use strict";
|
||||
arguments[1] = 7;
|
||||
--arguments[1];
|
||||
return arguments[1]===6;
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,27 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.4/11.4.6/11.4.6-2-1.js
|
||||
* @description +"" should be zero
|
||||
*/
|
||||
|
||||
|
||||
assertTruthy(+"" === 0);
|
|
@ -0,0 +1,27 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter11/11.4/11.4.7/11.4.7-4-1.js
|
||||
* @description -"" should be zero
|
||||
*/
|
||||
|
||||
|
||||
assertTruthy(-"" === 0);
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter12/12.10/12.10.1/12.10.1-11gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
with ({}) { }
|
|
@ -0,0 +1,48 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* local vars must not be visible outside with block
|
||||
* local functions must not be visible outside with block
|
||||
* local function expresssions should not be visible outside with block
|
||||
* local vars must shadow outer vars
|
||||
* local functions must shadow outer functions
|
||||
* local function expresssions must shadow outer function expressions
|
||||
* eval should use the appended object to the scope chain
|
||||
*
|
||||
* @path chapter12/12.14/12.14-5.js
|
||||
* @description catch introduces scope - block-local functions must shadow outer functions
|
||||
*/
|
||||
|
||||
|
||||
function testcase() {
|
||||
var o = {foo: function () { return 42;}};
|
||||
|
||||
try {
|
||||
throw o;
|
||||
}
|
||||
catch (e) {
|
||||
function foo() {}
|
||||
if (foo() === undefined) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter12/12.14/12.14.1/12.14.1-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
try { } catch (eval) { }
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter13/13.0/13_4-17gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
var _13_4_17_fun = new Function('eval = 42;');
|
||||
throw NotEarlyError;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter13/13.0/13_4-5gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
function _13_0_4_5_fun() { eval = 42; };
|
|
@ -23,9 +23,9 @@
|
|||
* @description Global.NaN is a data property with default attribute values (false)
|
||||
*/
|
||||
|
||||
var global = this;
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(global, 'NaN');
|
||||
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'NaN');
|
||||
if (desc.writable === false &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === false) {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
* @description Global.Infinity is a data property with default attribute values (false)
|
||||
*/
|
||||
|
||||
var global = this;
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(global, 'Infinity');
|
||||
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity');
|
||||
if (desc.writable === false &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === false) {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
* @description Global.undefined is a data property with default attribute values (false)
|
||||
*/
|
||||
|
||||
var global = this;
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(global, 'undefined');
|
||||
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'undefined');
|
||||
if (desc.writable === false &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === false) {
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/// Copyright (c) 2009 Microsoft Corporation
|
||||
///
|
||||
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
/// that the following conditions are met:
|
||||
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer.
|
||||
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
/// endorse or promote products derived from this software without specific prior written permission.
|
||||
///
|
||||
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @path chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-625gs.js
|
||||
*/
|
||||
|
||||
Object.defineProperty(Object.prototype,
|
||||
"prop",
|
||||
{ value: 1001, writable: false, enumerable: false, configurable: false}
|
||||
);
|
||||
var prop = 1002;
|
||||
|
||||
if (! (this.hasOwnProperty("prop") && prop === 1002)) {
|
||||
throw "this.prop should take precedence over Object.prototype.prop";
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-10-4gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
throw NotEarlyError;
|
||||
var _15_3_2_1_10_4_fun = new Function('param_1', 'param_2', 'param_1', '"use strict"; return 0;');
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-10-6gs.js
|
||||
*/
|
||||
|
||||
throw NotEarlyError;
|
||||
var _15_3_2_1_10_6_fun = new Function('param_1', 'param_2', 'param_1', '"use strict";return 0;');
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter15/15.3/15.3.5/15.3.5-1gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function _15_3_5_1_gs() {}
|
||||
throw NotEarlyError;
|
||||
_15_3_5_1_gs.caller;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
|
||||
/**
|
||||
* @path chapter15/15.3/15.3.5/15.3.5-2gs.js
|
||||
* @strict_only
|
||||
*/
|
||||
|
||||
|
||||
function _15_3_5_1_gs() {}
|
||||
_15_3_5_1_gs.caller;
|
||||
throw NotEarlyError;
|
Loading…
Reference in New Issue