aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts')
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js201
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js85
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js71
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js1
9 files changed, 728 insertions, 0 deletions
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js
new file mode 100644
index 0000000000..1e7e0254bf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js
@@ -0,0 +1,201 @@
+/* -*- 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 JavaScript Engine testing utilities.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corp.
+ * Portions created by the Initial Developer are Copyright (C) 2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * pschwartau@netscape.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 ***** */
+
+/*
+ *
+ * Date: 11 Feb 2002
+ * SUMMARY: Testing functions having duplicate formal parameter names
+ *
+ * Note: given function f(x,x,x,x) {return x;}; f(1,2,3,4) should return 4.
+ * See ECMA-262 3rd Edition Final Section 10.1.3: Variable Instantiation
+ *
+ * Also see http://bugzilla.mozilla.org/show_bug.cgi?id=124900
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '10.1.3-1.js';
+var UBound = 0;
+var BUGNUMBER = 124900;
+var summary = 'Testing functions having duplicate formal parameter names';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+function f1(x,x)
+{
+ return x;
+}
+status = inSection(1);
+actual = f1(1,2);
+expect = 2;
+addThis();
+
+
+function f2(x,x,x)
+{
+ return x*x*x;
+}
+status = inSection(2);
+actual = f2(1,2,3);
+expect = 27;
+addThis();
+
+
+function f3(x,x,x,x)
+{
+ return 'a' + x + 'b' + x + 'c' + x ;
+}
+status = inSection(3);
+actual = f3(1,2,3,4);
+expect = 'a4b4c4';
+addThis();
+
+
+/*
+ * If the value of the last duplicate parameter is not provided by
+ * the function caller, the value of this parameter is undefined
+ */
+function f4(x,a,b,x,z)
+{
+ return x;
+}
+status = inSection(4);
+actual = f4(1,2);
+expect = undefined;
+addThis();
+
+
+/*
+ * f.toString() should preserve any duplicate formal parameter names that exist
+ */
+function f5(x,x,x,x)
+{
+}
+status = inSection(5);
+actual = f5.toString().match(/\((.*)\)/)[1];
+actual = actual.replace(/\s/g, ''); // for definiteness, remove any white space
+expect = 'x,x,x,x';
+addThis();
+
+
+function f6(x,x,x,x)
+{
+ var ret = [];
+
+ for (var i=0; i<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(6);
+actual = f6(1,2,3,4);
+expect = '1,2,3,4';
+addThis();
+
+
+/*
+ * This variation (assigning to x inside f) is from nboyd@atg.com
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=124900
+ */
+function f7(x,x,x,x)
+{
+ x = 999;
+ var ret = [];
+
+ for (var i=0; i<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(7);
+actual = f7(1,2,3,4);
+expect = '1,2,3,999';
+addThis();
+
+
+/*
+ * Same as above, but with |var| keyword added -
+ */
+function f8(x,x,x,x)
+{
+ var x = 999;
+ var ret = [];
+
+ for (var i=0; i<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(8);
+actual = f8(1,2,3,4);
+expect = '1,2,3,999';
+addThis();
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = actual;
+ expectedvalues[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc('test');
+ printBugNumber(BUGNUMBER);
+ printStatus(summary);
+
+ for (var i=0; i<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js
new file mode 100644
index 0000000000..b2e22e6c55
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js
@@ -0,0 +1,70 @@
+/* -*- 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 JavaScript Engine testing utilities.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2007
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Martin Honnen
+ *
+ * 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 ***** */
+
+var gTestfile = '10.1.3-2.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 395907;
+var summary = 'eval of function declaration should change existing variable';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = 'typeof x: number, typeof x: function, x(): true';
+ var x = "string";
+ function f () {
+ var x = 0;
+ actual += 'typeof x: ' + (typeof x) + ', ';
+ eval('function x() { return true; }');
+ actual += 'typeof x: ' + (typeof x) + ', ';
+ actual += 'x(): ' + x();
+ }
+ f();
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js
new file mode 100644
index 0000000000..45a81f1f3a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** 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):
+ * Rob Ginda rginda@netscape.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 ***** */
+
+var gTestfile = '10.1.3.js';
+
+/**
+ ECMA Section: 10.1.3: Variable Instantiation
+ FunctionDeclarations are processed before VariableDeclarations, and
+ VariableDeclarations don't replace existing values with undefined
+*/
+
+test();
+
+function f()
+{
+ var x;
+
+ return typeof x;
+
+ function x()
+ {
+ return 7;
+ }
+}
+
+function test()
+{
+ enterFunc ("test");
+
+ printStatus ("ECMA Section: 10.1.3: Variable Instantiation.");
+ printBugNumber (17290);
+
+ reportCompare ("function", f(), "Declaration precedence test");
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js
new file mode 100644
index 0000000000..896841fa29
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** 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):
+ * Rob Ginda rginda@netscape.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 ***** */
+
+var gTestfile = '10.1.4-1.js';
+
+/**
+ ECMA Section: 10.1.4.1 Entering An Execution Context
+ ECMA says:
+ * Global Code, Function Code
+ Variable instantiation is performed using the global object as the
+ variable object and using property attributes { DontDelete }.
+
+ * Eval Code
+ Variable instantiation is performed using the calling context's
+ variable object and using empty property attributes.
+*/
+
+var BUGNUMBER = '(none)';
+var summary = '10.1.4.1 Entering An Execution Context';
+var actual = '';
+var expect = '';
+
+test();
+
+function test()
+{
+ enterFunc ("test");
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var y;
+ eval("var x = 1");
+
+ if (delete y)
+ reportCompare('PASS', 'FAIL', "Expected *NOT* to be able to delete y");
+
+ if (typeof x == "undefined")
+ reportCompare('PASS', 'FAIL', "x did not remain defined after eval()");
+ else if (x != 1)
+ reportCompare('PASS', 'FAIL', "x did not retain it's value after eval()");
+
+ if (!delete x)
+ reportCompare('PASS', 'FAIL', "Expected to be able to delete x");
+
+ reportCompare('PASS', 'PASS', '10.1.4.1 Entering An Execution Context');
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js
new file mode 100755
index 0000000000..6fbe85e19f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js
@@ -0,0 +1,136 @@
+/* -*- 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 JavaScript Engine testing utilities.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Bryant Chen
+ *
+ * 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 ***** */
+
+var gTestfile = '10.6.1-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 290774;
+var summary = 'activation object never delegates to Object.prototype';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var toStringResult;
+var evalResult;
+var watchResult;
+var parseIntResult;
+
+var eval = 'fooEval';
+var watch = undefined;
+var parseInt = 'fooParseInt';
+
+
+function toString()
+{
+ return 'fooString';
+}
+
+function normal()
+{
+ toStringResult = toString;
+ evalResult = eval;
+ watchResult = watch;
+ parseIntResult = parseInt;
+}
+
+function outerinnervar()
+{
+ toStringResult = toString;
+ evalResult = eval;
+ watchResult = watch;
+ parseIntResult = parseInt;
+ function inner()
+ {
+ // addition of any statement
+ // which accesses a variable
+ // from the outer scope causes the bug
+ printStatus(toString);
+ }
+}
+
+expect = true;
+
+printStatus('normal');
+printStatus('======');
+normal();
+
+printStatus('toStringResult ' + toStringResult);
+printStatus('toString ' + toString);
+actual = ((toStringResult + '') == (toString + ''));
+reportCompare(expect, actual, inSection(1));
+
+printStatus('evalResult ' + evalResult);
+printStatus('eval ' + eval);
+actual = ((evalResult + '') == (eval + ''));
+reportCompare(expect, actual, inSection(2));
+
+printStatus('watchResult ' + watchResult);
+printStatus('watch ' + watch);
+actual = ((watchResult + '') == (watch + ''));
+reportCompare(expect, actual, inSection(3));
+
+printStatus('parseIntResult ' + parseIntResult);
+printStatus('parseInt ' + parseInt);
+actual = ((parseIntResult + '') == (parseInt + ''));
+reportCompare(expect, actual, inSection(4));
+
+printStatus('outerinner');
+printStatus('==========');
+
+outerinnervar();
+
+printStatus('toStringResult ' + toStringResult);
+printStatus('toString ' + toString);
+actual = ((toStringResult + '') == (toString + ''));
+reportCompare(expect, actual, inSection(5));
+
+
+printStatus('evalResult ' + evalResult);
+printStatus('eval ' + eval);
+actual = ((evalResult + '') == (eval + ''));
+reportCompare(expect, actual, inSection(6));
+
+printStatus('watchResult ' + watchResult);
+printStatus('watch ' + watch);
+actual = ((watchResult + '') == (watch + ''));
+reportCompare(expect, actual, inSection(7));
+
+printStatus('parseIntResult ' + parseIntResult);
+printStatus('parseInt ' + parseInt);
+actual = ((parseIntResult + '') == (parseInt + ''));
+reportCompare(expect, actual, inSection(8));
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js
new file mode 100644
index 0000000000..6283d886f0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** 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):
+ * Rob Ginda rginda@netscape.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 ***** */
+
+var gTestfile = 'regress-23346.js';
+
+var CALL_CALLED = "PASSED";
+
+test();
+
+function f(x)
+{
+ if (x)
+ return call();
+
+ return "FAILED!";
+}
+
+function call()
+{
+ return CALL_CALLED;
+}
+
+function test()
+{
+ enterFunc ("test");
+
+ printStatus ("ECMA Section: 10.1.3: Variable Instantiation.");
+ printBugNumber (23346);
+
+ reportCompare ("PASSED", f(true),
+ "Unqualified reference should not see Function.prototype");
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js
new file mode 100755
index 0000000000..f303199b51
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.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 JavaScript Engine testing utilities.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Oliver Hunt
+ *
+ * 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 ***** */
+
+var gTestfile = 'regress-448595-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 448595;
+var summary = 'scope chain var declaration with initialiser in |with| clauses';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var f;
+
+ expect = 'bar';
+
+ f = function(){
+ var e = "bar";
+ with({e:"foo"}) {
+ var e = "wibble";
+ };
+
+ actual = e;
+ }
+
+ f();
+
+ reportCompare(expect, actual, summary + ': with');
+
+ f = function(){
+ var e = "bar";
+ try
+ {
+ throw {e:"foo"};
+ }
+ catch(e) {
+ var e = "wibble";
+ };
+
+ actual = e;
+ }
+
+ f();
+
+ reportCompare(expect, actual, summary + ': catch');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js
new file mode 100644
index 0000000000..1d353cff74
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'ExecutionContexts';