aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/parserstress/tests/ecma/ExecutionContexts')
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js107
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js170
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js105
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js118
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js122
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js133
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js1
25 files changed, 2484 insertions, 0 deletions
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js
new file mode 100644
index 0000000000..699296d6b1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.3-1.js';
+
+/**
+ File Name: 10.1.3-1.js
+ ECMA Section: 10.1.3
+ Description:
+
+ For each formal parameter, as defined in the FormalParameterList, create
+ a property of the variable object whose name is the Identifier and whose
+ attributes are determined by the type of code. The values of the
+ parameters are supplied by the caller. If the caller supplies fewer
+ parameter values than there are formal parameters, the extra formal
+ parameters have value undefined. If two or more formal parameters share
+ the same name, hence the same property, the corresponding property is
+ given the value that was supplied for the last parameter with this name.
+ If the value of this last parameter was not supplied by the caller,
+ the value of the corresponding property is undefined.
+
+
+ http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104191
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.1.3-1";
+var VERSION = "ECMA_1";
+var TITLE = "Variable Instantiation: Formal Parameters";
+var BUGNUMBER="104191";
+startTest();
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var myfun1 = new Function( "a", "a", "return a" );
+var myfun2 = new Function( "a", "b", "a", "return a" );
+
+function myfun3(a, b, a) {
+ return a;
+}
+
+// myfun1, myfun2, myfun3 tostring
+
+
+new TestCase(
+ SECTION,
+ String(myfun2) +"; myfun2(2,4,8)",
+ 8,
+ myfun2(2,4,8) );
+
+new TestCase(
+ SECTION,
+ "myfun2(2,4)",
+ void 0,
+ myfun2(2,4));
+
+new TestCase(
+ SECTION,
+ String(myfun3) +"; myfun3(2,4,8)",
+ 8,
+ myfun3(2,4,8) );
+
+new TestCase(
+ SECTION,
+ "myfun3(2,4)",
+ void 0,
+ myfun3(2,4) );
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js
new file mode 100755
index 0000000000..3762842461
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): mozilla@florian.loitsch.com
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.3-2.js';
+
+/**
+ File Name: 10.1.3-1.js
+ ECMA Section: 10.1.3
+ Description:
+
+ Author: mozilla@florian.loitsch.com
+ Date: 27 July 2005
+*/
+
+var SECTION = "10.1.3-2";
+var VERSION = "ECMA_1";
+var TITLE = "Variable Instantiation: Function Declarations";
+var BUGNUMBER="299639";
+startTest();
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function f(g)
+{
+ function g() {
+ return "g";
+ };
+ return g;
+}
+
+new TestCase(
+ SECTION,
+ "typeof f(\"parameter\")",
+ "function",
+ typeof f("parameter") );
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js
new file mode 100644
index 0000000000..fd466de210
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.3.js';
+
+/**
+ File Name: 10.1.3.js
+ ECMA Section: 10.1.3.js Variable Instantiation
+ Description:
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+
+var SECTION = "10.1.3";
+var VERSION = "ECMA_1";
+var TITLE = "Variable instantiation";
+var BUGNUMBER = "20256";
+startTest();
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+
+// overriding a variable or function name with a function should succeed
+
+new TestCase(SECTION,
+ "function t() { return \"first\" };" +
+ "function t() { return \"second\" };t() ",
+ "second",
+ eval("function t() { return \"first\" };" +
+ "function t() { return \"second\" };t()"));
+
+
+new TestCase(SECTION,
+ "var t; function t(){}; typeof(t)",
+ "function",
+ eval("var t; function t(){}; typeof(t)"));
+
+
+// formal parameter tests
+
+new TestCase(SECTION,
+ "function t1(a,b) { return b; }; t1( 4 );",
+ void 0,
+ eval("function t1(a,b) { return b; }; t1( 4 );") );
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a; }; t1(4);",
+ 4,
+ eval("function t1(a,b) { return a; }; t1(4)"));
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a; }; t1();",
+ void 0,
+ eval("function t1(a,b) { return a; }; t1()"));
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a; }; t1(1,2,4);",
+ 1,
+ eval("function t1(a,b) { return a; }; t1(1,2,4)"));
+/*
+
+new TestCase(SECTION, "function t1(a,a) { return a; }; t1( 4 );",
+void 0,
+eval("function t1(a,a) { return a; }; t1( 4 )"));
+
+new TestCase(SECTION,
+"function t1(a,a) { return a; }; t1( 1,2 );",
+2,
+eval("function t1(a,a) { return a; }; t1( 1,2 )"));
+*/
+// variable declarations
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a; }; t1( false, true );",
+ false,
+ eval("function t1(a,b) { return a; }; t1( false, true );"));
+
+new TestCase(SECTION,
+ "function t1(a,b) { return b; }; t1( false, true );",
+ true,
+ eval("function t1(a,b) { return b; }; t1( false, true );"));
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a+b; }; t1( 4, 2 );",
+ 6,
+ eval("function t1(a,b) { return a+b; }; t1( 4, 2 );"));
+
+new TestCase(SECTION,
+ "function t1(a,b) { return a+b; }; t1( 4 );",
+ Number.NaN,
+ eval("function t1(a,b) { return a+b; }; t1( 4 );"));
+
+// overriding a function name with a variable should fail
+
+new TestCase(SECTION,
+ "function t() { return 'function' };" +
+ "var t = 'variable'; typeof(t)",
+ "string",
+ eval("function t() { return 'function' };" +
+ "var t = 'variable'; typeof(t)"));
+
+// function as a constructor
+
+new TestCase(SECTION,
+ "function t1(a,b) { var a = b; return a; } t1(1,3);",
+ 3,
+ eval("function t1(a, b){ var a = b; return a;}; t1(1,3)"));
+
+new TestCase(SECTION,
+ "function t2(a,b) { this.a = b; } x = new t2(1,3); x.a",
+ 3,
+ eval("function t2(a,b) { this.a = b; };" +
+ "x = new t2(1,3); x.a"));
+
+new TestCase(SECTION,
+ "function t2(a,b) { this.a = a; } x = new t2(1,3); x.a",
+ 1,
+ eval("function t2(a,b) { this.a = a; };" +
+ "x = new t2(1,3); x.a"));
+
+new TestCase(SECTION,
+ "function t2(a,b) { this.a = b; this.b = a; } " +
+ "x = new t2(1,3);x.a;",
+ 3,
+ eval("function t2(a,b) { this.a = b; this.b = a; };" +
+ "x = new t2(1,3);x.a;"));
+
+new TestCase(SECTION,
+ "function t2(a,b) { this.a = b; this.b = a; }" +
+ "x = new t2(1,3);x.b;",
+ 1,
+ eval("function t2(a,b) { this.a = b; this.b = a; };" +
+ "x = new t2(1,3);x.b;") );
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js
new file mode 100644
index 0000000000..ec49f20596
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-1.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION", "with MyObject, eval should return square of " );
+
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += "( " + INPUT +" )" ;
+
+ with ( MYOBJECT ) {
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = Math.pow(INPUT,2);
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js
new file mode 100644
index 0000000000..218031c83f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-10.js';
+
+/**
+ File Name: 10.1.4-10.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-10";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION", "MYOBJECT.toString()" );
+
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+ var VALUE = 12345;
+ var MYOBJECT = new Number( VALUE );
+
+ with ( MYOBJECT ) {
+ gTestcases[gTc].actual = toString();
+ gTestcases[gTc].expect = String(VALUE);
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js
new file mode 100644
index 0000000000..2aee831b45
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-2.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-2";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION", "with MyObject, eval should return square of " );
+
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += "( "+INPUT +" )" ;
+
+ with ( this ) {
+ with ( MYOBJECT ) {
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = Math.pow(INPUT,2);
+ }
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js
new file mode 100644
index 0000000000..a3ae0ffdec
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-3.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-3";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION",
+ "with MyObject, eval should be [object Global].eval " );
+
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += ( INPUT +"" );
+
+ with ( MYOBJECT ) {
+ eval( INPUT );
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js
new file mode 100644
index 0000000000..31274a0209
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-4.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION",
+ "with MyObject, eval should be [object Global].eval " );
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += ( INPUT +"" );
+
+ with ( MYOBJECT ) {
+ eval( INPUT );
+ }
+
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = INPUT;
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js
new file mode 100644
index 0000000000..c36d2db8cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-5.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION",
+ "with MyObject, eval should be [object Global].eval " );
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += ( INPUT +"" );
+
+ with ( MYOBJECT ) {
+ eval = null;
+ }
+
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = INPUT;
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js
new file mode 100644
index 0000000000..da11110cc5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-6.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-6";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+
+var testcase = new TestCase( "SECTION",
+ "with MyObject, eval should be [object Global].eval " );
+
+var MYOBJECT = new MyObject();
+var INPUT = 2;
+testcase.description += ( INPUT +"" );
+
+with ( MYOBJECT ) {
+ ;
+}
+testcase.actual = eval( INPUT );
+testcase.expect = INPUT;
+
+test();
+
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js
new file mode 100644
index 0000000000..f1a0db4569
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-7.js';
+
+/**
+ File Name: 10.1.4-7.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-7";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION",
+ "with MyObject, eval should be [object Global].eval " );
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += ( INPUT +"" );
+
+ with ( MYOBJECT ) {
+ delete( eval );
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = INPUT;
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js
new file mode 100644
index 0000000000..1eee8da4fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.4-8.js';
+
+/**
+ File Name: 10.1.4-1.js
+ ECMA Section: 10.1.4 Scope Chain and Identifier Resolution
+ Description:
+ Every execution context has associated with it a scope chain. This is
+ logically a list of objects that are searched when binding an Identifier.
+ When control enters an execution context, the scope chain is created and
+ is populated with an initial set of objects, depending on the type of
+ code. When control leaves the execution context, the scope chain is
+ destroyed.
+
+ During execution, the scope chain of the execution context is affected
+ only by WithStatement. When execution enters a with block, the object
+ specified in the with statement is added to the front of the scope chain.
+ When execution leaves a with block, whether normally or via a break or
+ continue statement, the object is removed from the scope chain. The object
+ being removed will always be the first object in the scope chain.
+
+ During execution, the syntactic production PrimaryExpression : Identifier
+ is evaluated using the following algorithm:
+
+ 1. Get the next object in the scope chain. If there isn't one, go to step 5.
+ 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as
+ the property.
+ 3. If Result(2) is true, return a value of type Reference whose base object
+ is Result(l) and whose property name is the Identifier.
+ 4. Go to step 1.
+ 5. Return a value of type Reference whose base object is null and whose
+ property name is the Identifier.
+ The result of binding an identifier is always a value of type Reference with
+ its member name component equal to the identifier string.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.1.4-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution");
+
+new TestCase( "SECTION",
+ "with MyObject, eval should cube INPUT: " );
+test();
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ var MYOBJECT = new MyObject();
+ var INPUT = 2;
+ gTestcases[gTc].description += ( INPUT +"" );
+
+ with ( MYOBJECT ) {
+ eval = new Function ( "x", "return(Math.pow(Number(x),3))" );
+
+ gTestcases[gTc].actual = eval( INPUT );
+ gTestcases[gTc].expect = Math.pow(INPUT,3);
+ }
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+function MyObject() {
+ this.eval = new Function( "x", "return(Math.pow(Number(x),2))" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js
new file mode 100644
index 0000000000..363581eff6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.5-1.js';
+
+/**
+ File Name: 10.1.5-1.js
+ ECMA Section: 10.1.5 Global Object
+ Description:
+ There is a unique global object which is created before control enters
+ any execution context. Initially the global object has the following
+ properties:
+
+ Built-in objects such as Math, String, Date, parseInt, etc. These have
+ attributes { DontEnum }.
+
+ Additional host defined properties. This may include a property whose
+ value is the global object itself, for example window in HTML.
+
+ As control enters execution contexts, and as ECMAScript code is executed,
+ additional properties may be added to the global object and the initial
+ properties may be changed.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.5.1-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Global Object");
+
+
+new TestCase( "SECTION", "Global Code check" );
+
+if ( Object == null ) {
+ gTestcases[0].reason += " Object == null" ;
+}
+if ( Function == null ) {
+ gTestcases[0].reason += " Function == null";
+}
+if ( String == null ) {
+ gTestcases[0].reason += " String == null";
+}
+if ( Array == null ) {
+ gTestcases[0].reason += " Array == null";
+}
+if ( Number == null ) {
+ gTestcases[0].reason += " Function == null";
+}
+if ( Math == null ) {
+ gTestcases[0].reason += " Math == null";
+}
+if ( Boolean == null ) {
+ gTestcases[0].reason += " Boolean == null";
+}
+if ( Date == null ) {
+ gTestcases[0].reason += " Date == null";
+}
+/*
+ if ( NaN == null ) {
+ gTestcases[0].reason += " NaN == null";
+ }
+ if ( Infinity == null ) {
+ gTestcases[0].reason += " Infinity == null";
+ }
+*/
+if ( eval == null ) {
+ gTestcases[0].reason += " eval == null";
+}
+if ( parseInt == null ) {
+ gTestcases[0].reason += " parseInt == null";
+}
+
+if ( gTestcases[0].reason != "" ) {
+ gTestcases[0].actual = "fail";
+} else {
+ gTestcases[0].actual = "pass";
+}
+gTestcases[0].expect = "pass";
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js
new file mode 100644
index 0000000000..cfba3b5c73
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.5-2.js';
+
+/**
+ File Name: 10.1.5-2.js
+ ECMA Section: 10.1.5 Global Object
+ Description:
+ There is a unique global object which is created before control enters
+ any execution context. Initially the global object has the following
+ properties:
+
+ Built-in objects such as Math, String, Date, parseInt, etc. These have
+ attributes { DontEnum }.
+
+ Additional host defined properties. This may include a property whose
+ value is the global object itself, for example window in HTML.
+
+ As control enters execution contexts, and as ECMAScript code is executed,
+ additional properties may be added to the global object and the initial
+ properties may be changed.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.5.1-2";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Global Object");
+
+new TestCase( "SECTION", "Eval Code check" );
+
+var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' +
+ 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' +
+ 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' +
+ 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' +
+ 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' +
+ 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' +
+ 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' +
+ 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' +
+ 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' +
+ 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ;
+
+eval( EVAL_STRING );
+
+/*
+ if ( NaN == null ) {
+ gTestcases[0].reason += " NaN == null";
+ }
+ if ( Infinity == null ) {
+ gTestcases[0].reason += " Infinity == null";
+ }
+*/
+
+if ( gTestcases[0].reason != "" ) {
+ gTestcases[0].actual = "fail";
+} else {
+ gTestcases[0].actual = "pass";
+}
+gTestcases[0].expect = "pass";
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js
new file mode 100644
index 0000000000..f5234cb13b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.5-3.js';
+
+/**
+ File Name: 10.1.5-3.js
+ ECMA Section: 10.1.5 Global Object
+ Description:
+ There is a unique global object which is created before control enters
+ any execution context. Initially the global object has the following
+ properties:
+
+ Built-in objects such as Math, String, Date, parseInt, etc. These have
+ attributes { DontEnum }.
+
+ Additional host defined properties. This may include a property whose
+ value is the global object itself, for example window in HTML.
+
+ As control enters execution contexts, and as ECMAScript code is executed,
+ additional properties may be added to the global object and the initial
+ properties may be changed.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.5.1-3";
+var VERSION = "ECMA_1";
+startTest();
+writeHeaderToLog( SECTION + " Global Object");
+
+new TestCase( "SECTION", "Function Code check" );
+
+test();
+
+function test() {
+ if ( Object == null ) {
+ gTestcases[0].reason += " Object == null" ;
+ }
+ if ( Function == null ) {
+ gTestcases[0].reason += " Function == null";
+ }
+ if ( String == null ) {
+ gTestcases[0].reason += " String == null";
+ }
+ if ( Array == null ) {
+ gTestcases[0].reason += " Array == null";
+ }
+ if ( Number == null ) {
+ gTestcases[0].reason += " Function == null";
+ }
+ if ( Math == null ) {
+ gTestcases[0].reason += " Math == null";
+ }
+ if ( Boolean == null ) {
+ gTestcases[0].reason += " Boolean == null";
+ }
+ if ( Date == null ) {
+ gTestcases[0].reason += " Date == null";
+ }
+/*
+ if ( NaN == null ) {
+ gTestcases[0].reason += " NaN == null";
+ }
+ if ( Infinity == null ) {
+ gTestcases[0].reason += " Infinity == null";
+ }
+*/
+ if ( eval == null ) {
+ gTestcases[0].reason += " eval == null";
+ }
+ if ( parseInt == null ) {
+ gTestcases[0].reason += " parseInt == null";
+ }
+
+ if ( gTestcases[0].reason != "" ) {
+ gTestcases[0].actual = "fail";
+ } else {
+ gTestcases[0].actual = "pass";
+ }
+ gTestcases[0].expect = "pass";
+
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+
+ gTestcases[gTc].actual );
+
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ stopTest();
+ return ( gTestcases );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js
new file mode 100644
index 0000000000..953e6a8feb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.5-4.js';
+
+/**
+ File Name: 10.1.5-4.js
+ ECMA Section: 10.1.5 Global Object
+ Description:
+ There is a unique global object which is created before control enters
+ any execution context. Initially the global object has the following
+ properties:
+
+ Built-in objects such as Math, String, Date, parseInt, etc. These have
+ attributes { DontEnum }.
+
+ Additional host defined properties. This may include a property whose
+ value is the global object itself, for example window in HTML.
+
+ As control enters execution contexts, and as ECMAScript code is executed,
+ additional properties may be added to the global object and the initial
+ properties may be changed.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "10.5.1-4";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Global Object");
+
+new TestCase( "SECTION", "Anonymous Code check" );
+
+
+var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' +
+ 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' +
+ 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' +
+ 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' +
+ 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' +
+ 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' +
+ 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' +
+ 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' +
+ 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' +
+ 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ;
+
+var NEW_FUNCTION = new Function( EVAL_STRING );
+
+if ( gTestcases[0].reason != "" ) {
+ gTestcases[0].actual = "fail";
+} else {
+ gTestcases[0].actual = "pass";
+}
+gTestcases[0].expect = "pass";
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js
new file mode 100644
index 0000000000..40e6f0ee8f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.8-2.js';
+
+/**
+ File Name: 10.1.8-2
+ ECMA Section: Arguments Object
+ Description:
+
+ When control enters an execution context for declared function code,
+ anonymous code, or implementation-supplied code, an arguments object is
+ created and initialized as follows:
+
+ The [[Prototype]] of the arguments object is to the original Object
+ prototype object, the one that is the initial value of Object.prototype
+ (section 15.2.3.1).
+
+ A property is created with name callee and property attributes {DontEnum}.
+ The initial value of this property is the function object being executed.
+ This allows anonymous functions to be recursive.
+
+ A property is created with name length and property attributes {DontEnum}.
+ The initial value of this property is the number of actual parameter values
+ supplied by the caller.
+
+ For each non-negative integer, iarg, less than the value of the length
+ property, a property is created with name ToString(iarg) and property
+ attributes { DontEnum }. The initial value of this property is the value
+ of the corresponding actual parameter supplied by the caller. The first
+ actual parameter value corresponds to iarg = 0, the second to iarg = 1 and
+ so on. In the case when iarg is less than the number of formal parameters
+ for the function object, this property shares its value with the
+ corresponding property of the activation object. This means that changing
+ this property changes the corresponding property of the activation object
+ and vice versa. The value sharing mechanism depends on the implementation.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.1.8-2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Arguments Object";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// Tests for anonymous functions
+
+var GetCallee = new Function( "var c = arguments.callee; return c" );
+var GetArguments = new Function( "var a = arguments; return a" );
+var GetLength = new Function( "var l = arguments.length; return l" );
+
+var ARG_STRING = "value of the argument property";
+
+new TestCase( SECTION,
+ "GetCallee()",
+ GetCallee,
+ GetCallee() );
+
+var LIMIT = 100;
+
+for ( var i = 0, args = "" ; i < LIMIT; i++ ) {
+ args += String(i) + ( i+1 < LIMIT ? "," : "" );
+
+}
+
+var LENGTH = eval( "GetLength("+ args +")" );
+
+new TestCase( SECTION,
+ "GetLength("+args+")",
+ 100,
+ LENGTH );
+
+var ARGUMENTS = eval( "GetArguments( " +args+")" );
+
+for ( var i = 0; i < 100; i++ ) {
+ new TestCase( SECTION,
+ "GetArguments("+args+")["+i+"]",
+ i,
+ ARGUMENTS[i] );
+}
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js
new file mode 100644
index 0000000000..71aa876f02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Norris Boyd
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.1.8-3.js';
+
+/**
+ File Name: 10.1.8-3
+ ECMA Section: Arguments Object
+ Description:
+
+ The [[Prototype]] of the arguments object is to the original Object
+ prototype object, the one that is the initial value of Object.prototype
+ (section 15.2.3.1).
+
+ ...
+
+ Test that "typeof arguments" is thus "object".
+
+*/
+
+var SECTION = "10.1.8-2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Arguments Object";
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var expected = "object";
+var actual = (function () { return typeof arguments; })();
+reportCompare(expected, actual, "typeof arguments == object");
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js
new file mode 100644
index 0000000000..5384da4f83
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.2.1.js';
+
+/**
+ File Name: 10.2.1.js
+ ECMA Section: 10.2.1 Global Code
+ Description:
+
+ The scope chain is created and initialized to contain the global object and
+ no others.
+
+ Variable instantiation is performed using the global object as the variable
+ object and using empty property attributes.
+
+ The this value is the global object.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.2.1";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Global Code";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var THIS = this;
+
+new TestCase( SECTION,
+ "this +''",
+ GLOBAL,
+ THIS + "" );
+
+var GLOBAL_PROPERTIES = new Array();
+var i = 0;
+
+for ( p in this ) {
+ GLOBAL_PROPERTIES[i++] = p;
+}
+
+for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) {
+ new TestCase( SECTION,
+ GLOBAL_PROPERTIES[i] +" == void 0",
+ false,
+ eval("GLOBAL_PROPERTIES["+i+"] == void 0"));
+}
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js
new file mode 100644
index 0000000000..787ef9e5b3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.2.2-1.js';
+
+/**
+ File Name: 10.2.2-1.js
+ ECMA Section: 10.2.2 Eval Code
+ Description:
+
+ When control enters an execution context for eval code, the previous
+ active execution context, referred to as the calling context, is used to
+ determine the scope chain, the variable object, and the this value. If
+ there is no calling context, then initializing the scope chain, variable
+ instantiation, and determination of the this value are performed just as
+ for global code.
+
+ The scope chain is initialized to contain the same objects, in the same
+ order, as the calling context's scope chain. This includes objects added
+ to the calling context's scope chain by WithStatement.
+
+ Variable instantiation is performed using the calling context's variable
+ object and using empty property attributes.
+
+ The this value is the same as the this value of the calling context.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.2.2-1";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Eval Code";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var THIS = eval("this");
+
+new TestCase( SECTION,
+ "this +''",
+ GLOBAL,
+ THIS + "" );
+
+var GLOBAL_PROPERTIES = new Array();
+var i = 0;
+
+for ( p in THIS ) {
+ GLOBAL_PROPERTIES[i++] = p;
+}
+
+for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) {
+ new TestCase( SECTION,
+ GLOBAL_PROPERTIES[i] +" == THIS["+GLOBAL_PROPERTIES[i]+"]",
+ true,
+ eval(GLOBAL_PROPERTIES[i]) == eval( "THIS[GLOBAL_PROPERTIES[i]]") );
+}
+
+// this in eval statements is the same as this value of the calling context
+
+var RESULT = THIS == this;
+
+new TestCase( SECTION,
+ "eval( 'this == THIS' )",
+ true,
+ RESULT );
+
+var RESULT = THIS +'';
+
+new TestCase( SECTION,
+ "eval( 'this + \"\"' )",
+ GLOBAL,
+ RESULT );
+
+
+new TestCase( SECTION,
+ "eval( 'this == THIS' )",
+ true,
+ eval( "this == THIS" ) );
+
+new TestCase( SECTION,
+ "eval( 'this + \"\"' )",
+ GLOBAL,
+ eval( "this +''") );
+
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js
new file mode 100644
index 0000000000..8048c45575
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.2.2-2.js';
+
+/**
+ File Name: 10.2.2-2.js
+ ECMA Section: 10.2.2 Eval Code
+ Description:
+
+ When control enters an execution context for eval code, the previous
+ active execution context, referred to as the calling context, is used to
+ determine the scope chain, the variable object, and the this value. If
+ there is no calling context, then initializing the scope chain, variable
+ instantiation, and determination of the this value are performed just as
+ for global code.
+
+ The scope chain is initialized to contain the same objects, in the same
+ order, as the calling context's scope chain. This includes objects added
+ to the calling context's scope chain by WithStatement.
+
+ Variable instantiation is performed using the calling context's variable
+ object and using empty property attributes.
+
+ The this value is the same as the this value of the calling context.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.2.2-2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Eval Code";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// Test Objects
+
+var OBJECT = new MyObject( "hello" );
+var GLOBAL_PROPERTIES = new Array();
+var i = 0;
+
+for ( p in this ) {
+ GLOBAL_PROPERTIES[i++] = p;
+}
+
+with ( OBJECT ) {
+ var THIS = this;
+ new TestCase( SECTION,
+ "eval( 'this == THIS' )",
+ true,
+ eval("this == THIS") );
+ new TestCase( SECTION,
+ "this in a with() block",
+ GLOBAL,
+ this+"" );
+ new TestCase( SECTION,
+ "new MyObject('hello').value",
+ "hello",
+ value );
+ new TestCase( SECTION,
+ "eval(new MyObject('hello').value)",
+ "hello",
+ eval("value") );
+ new TestCase( SECTION,
+ "new MyObject('hello').getClass()",
+ "[object Object]",
+ getClass() );
+ new TestCase( SECTION,
+ "eval(new MyObject('hello').getClass())",
+ "[object Object]",
+ eval("getClass()") );
+ new TestCase( SECTION,
+ "eval(new MyObject('hello').toString())",
+ "hello",
+ eval("toString()") );
+ new TestCase( SECTION,
+ "eval('getClass') == Object.prototype.toString",
+ true,
+ eval("getClass") == Object.prototype.toString );
+
+ for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) {
+ new TestCase( SECTION, GLOBAL_PROPERTIES[i] +
+ " == THIS["+GLOBAL_PROPERTIES[i]+"]", true,
+ eval(GLOBAL_PROPERTIES[i]) == eval( "THIS[GLOBAL_PROPERTIES[i]]") );
+ }
+
+}
+
+test();
+
+function MyObject( value ) {
+ this.value = value;
+ this.getClass = Object.prototype.toString;
+ this.toString = new Function( "return this.value+''" );
+ return this;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js
new file mode 100644
index 0000000000..a1977c66d6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.2.3-1.js';
+
+/**
+ File Name: 10.2.3-1.js
+ ECMA Section: 10.2.3 Function and Anonymous Code
+ Description:
+
+ The scope chain is initialized to contain the activation object followed
+ by the global object. Variable instantiation is performed using the
+ activation by the global object. Variable instantiation is performed using
+ the activation object as the variable object and using property attributes
+ { DontDelete }. The caller provides the this value. If the this value
+ provided by the caller is not an object (including the case where it is
+ null), then the this value is the global object.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.2.3-1";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Eval Code";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var o = new MyObject("hello")
+
+ new TestCase( SECTION,
+ "var o = new MyObject('hello'); o.THIS == x",
+ true,
+ o.THIS == o );
+
+var o = MyFunction();
+
+new TestCase( SECTION,
+ "var o = MyFunction(); o == this",
+ true,
+ o == this );
+
+test();
+
+function MyFunction( value ) {
+ return this;
+}
+function MyObject( value ) {
+ this.THIS = this;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js
new file mode 100644
index 0000000000..e1aa78c5da
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = '10.2.3-2.js';
+
+/**
+ File Name: 10.2.3-2.js
+ ECMA Section: 10.2.3 Function and Anonymous Code
+ Description:
+
+ The scope chain is initialized to contain the activation object followed
+ by the global object. Variable instantiation is performed using the
+ activation by the global object. Variable instantiation is performed using
+ the activation object as the variable object and using property attributes
+ { DontDelete }. The caller provides the this value. If the this value
+ provided by the caller is not an object (including the case where it is
+ null), then the this value is the global object.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "10.2.3-2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "Function and Anonymous Code";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var o = new MyObject("hello");
+
+new TestCase( SECTION,
+ "MyFunction(\"PASSED!\")",
+ "PASSED!",
+ MyFunction("PASSED!") );
+
+var o = MyFunction();
+
+new TestCase( SECTION,
+ "MyOtherFunction(true);",
+ false,
+ MyOtherFunction(true) );
+
+test();
+
+function MyFunction( value ) {
+ var x = value;
+ delete x;
+ return x;
+}
+function MyOtherFunction(value) {
+ var x = value;
+ return delete x;
+}
+function MyObject( value ) {
+ this.THIS = this;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js
new file mode 100644
index 0000000000..1d353cff74
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'ExecutionContexts';