aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/parserstress/tests/ecma/TypeConversion
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/parserstress/tests/ecma/TypeConversion')
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js138
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js323
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js743
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js173
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js160
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js167
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js119
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js1
15 files changed, 2462 insertions, 0 deletions
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js
new file mode 100644
index 0000000000..2d428b9a9e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js
@@ -0,0 +1,138 @@
+/* -*- 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): christine@netscape.com
+ * Jesse Ruderman
+ *
+ * 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 = '9.2.js';
+
+/**
+ File Name: 9.2.js
+ ECMA Section: 9.2 Type Conversion: ToBoolean
+ Description: rules for converting an argument to a boolean.
+ undefined false
+ Null false
+ Boolean input argument( no conversion )
+ Number returns false for 0, -0, and NaN
+ otherwise return true
+ String return false if the string is empty
+ (length is 0) otherwise the result is
+ true
+ Object all return true
+
+ Author: christine@netscape.com
+ Date: 14 july 1997
+*/
+var SECTION = "9.2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "ToBoolean";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// special cases here
+
+new TestCase( SECTION, "Boolean()", false, Boolean() );
+new TestCase( SECTION, "Boolean(var x)", false, Boolean(eval("var x")) );
+new TestCase( SECTION, "Boolean(void 0)", false, Boolean(void 0) );
+new TestCase( SECTION, "Boolean(null)", false, Boolean(null) );
+new TestCase( SECTION, "Boolean(false)", false, Boolean(false) );
+new TestCase( SECTION, "Boolean(true)", true, Boolean(true) );
+new TestCase( SECTION, "Boolean(0)", false, Boolean(0) );
+new TestCase( SECTION, "Boolean(-0)", false, Boolean(-0) );
+new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) );
+new TestCase( SECTION, "Boolean('')", false, Boolean("") );
+
+// normal test cases here
+
+new TestCase( SECTION, "Boolean(Infinity)", true, Boolean(Number.POSITIVE_INFINITY) );
+new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) );
+new TestCase( SECTION, "Boolean(Math.PI)", true, Boolean(Math.PI) );
+new TestCase( SECTION, "Boolean(1)", true, Boolean(1) );
+new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) );
+new TestCase( SECTION, "Boolean([tab])", true, Boolean("\t") );
+new TestCase( SECTION, "Boolean('0')", true, Boolean("0") );
+new TestCase( SECTION, "Boolean('string')", true, Boolean("string") );
+
+// ToBoolean (object) should always return true.
+new TestCase( SECTION, "Boolean(new String() )", true, Boolean(new String()) );
+new TestCase( SECTION, "Boolean(new String('') )", true, Boolean(new String("")) );
+
+new TestCase( SECTION, "Boolean(new Boolean(true))", true, Boolean(new Boolean(true)) );
+new TestCase( SECTION, "Boolean(new Boolean(false))", true, Boolean(new Boolean(false)) );
+new TestCase( SECTION, "Boolean(new Boolean() )", true, Boolean(new Boolean()) );
+
+new TestCase( SECTION, "Boolean(new Array())", true, Boolean(new Array()) );
+
+new TestCase( SECTION, "Boolean(new Number())", true, Boolean(new Number()) );
+new TestCase( SECTION, "Boolean(new Number(-0))", true, Boolean(new Number(-0)) );
+new TestCase( SECTION, "Boolean(new Number(0))", true, Boolean(new Number(0)) );
+new TestCase( SECTION, "Boolean(new Number(NaN))", true, Boolean(new Number(Number.NaN)) );
+
+new TestCase( SECTION, "Boolean(new Number(-1))", true, Boolean(new Number(-1)) );
+new TestCase( SECTION, "Boolean(new Number(Infinity))", true, Boolean(new Number(Number.POSITIVE_INFINITY)) );
+new TestCase( SECTION, "Boolean(new Number(-Infinity))",true, Boolean(new Number(Number.NEGATIVE_INFINITY)) );
+
+new TestCase( SECTION, "Boolean(new Object())", true, Boolean(new Object()) );
+new TestCase( SECTION, "Boolean(new Function())", true, Boolean(new Function()) );
+new TestCase( SECTION, "Boolean(new Date())", true, Boolean(new Date()) );
+new TestCase( SECTION, "Boolean(new Date(0))", true, Boolean(new Date(0)) );
+new TestCase( SECTION, "Boolean(Math)", true, Boolean(Math) );
+
+// bug 375793
+new TestCase( SECTION,
+ "NaN ? true : false",
+ false,
+ (NaN ? true : false) );
+new TestCase( SECTION,
+ "1000 % 0 ? true : false",
+ false,
+ (1000 % 0 ? true : false) );
+new TestCase( SECTION,
+ "(function(a,b){ return a % b ? true : false })(1000, 0)",
+ false,
+ ((function(a,b){ return a % b ? true : false })(1000, 0)) );
+
+new TestCase( SECTION,
+ "(function(x) { return !(x) })(0/0)",
+ true,
+ ((function(x) { return !(x) })(0/0)) );
+new TestCase( SECTION,
+ "!(0/0)",
+ true,
+ (!(0/0)) );
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js
new file mode 100644
index 0000000000..9994d6a7cd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.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 = '9.3-1.js';
+
+/**
+ File Name: 9.3-1.js
+ ECMA Section: 9.3 Type Conversion: ToNumber
+ Description: rules for converting an argument to a number.
+ see 9.3.1 for cases for converting strings to numbers.
+ special cases:
+ undefined NaN
+ Null NaN
+ Boolean 1 if true; +0 if false
+ Number the argument ( no conversion )
+ String see test 9.3.1
+ Object see test 9.3-1
+
+
+ This tests ToNumber applied to the object type, except
+ if object is string. See 9.3-2 for
+ ToNumber( String object).
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.3-1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " ToNumber");
+
+// object is Number
+new TestCase( SECTION, "Number(new Number())", 0, Number(new Number()) );
+new TestCase( SECTION, "typeof Number(new Number())", "number", typeof Number(new Number()) );
+
+new TestCase( SECTION, "Number(new Number(Number.NaN))", Number.NaN, Number(new Number(Number.NaN)) );
+new TestCase( SECTION, "typeof Number(new Number(Number.NaN))","number", typeof Number(new Number(Number.NaN)) );
+
+new TestCase( SECTION, "Number(new Number(0))", 0, Number(new Number(0)) );
+new TestCase( SECTION, "typeof Number(new Number(0))", "number", typeof Number(new Number(0)) );
+
+new TestCase( SECTION, "Number(new Number(null))", 0, Number(new Number(null)) );
+new TestCase( SECTION, "typeof Number(new Number(null))", "number", typeof Number(new Number(null)) );
+
+
+// new TestCase( SECTION, "Number(new Number(void 0))", Number.NaN, Number(new Number(void 0)) );
+new TestCase( SECTION, "Number(new Number(true))", 1, Number(new Number(true)) );
+new TestCase( SECTION, "typeof Number(new Number(true))", "number", typeof Number(new Number(true)) );
+
+new TestCase( SECTION, "Number(new Number(false))", 0, Number(new Number(false)) );
+new TestCase( SECTION, "typeof Number(new Number(false))", "number", typeof Number(new Number(false)) );
+
+// object is boolean
+new TestCase( SECTION, "Number(new Boolean(true))", 1, Number(new Boolean(true)) );
+new TestCase( SECTION, "typeof Number(new Boolean(true))", "number", typeof Number(new Boolean(true)) );
+
+new TestCase( SECTION, "Number(new Boolean(false))", 0, Number(new Boolean(false)) );
+new TestCase( SECTION, "typeof Number(new Boolean(false))", "number", typeof Number(new Boolean(false)) );
+
+// object is array
+new TestCase( SECTION, "Number(new Array(2,4,8,16,32))", Number.NaN, Number(new Array(2,4,8,16,32)) );
+new TestCase( SECTION, "typeof Number(new Array(2,4,8,16,32))", "number", typeof Number(new Array(2,4,8,16,32)) );
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js
new file mode 100644
index 0000000000..da3e8794c0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js
@@ -0,0 +1,323 @@
+/* -*- 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 = '9.3.1-1.js';
+
+/**
+ File Name: 9.3.1-1.js
+ ECMA Section: 9.3 Type Conversion: ToNumber
+ Description: rules for converting an argument to a number.
+ see 9.3.1 for cases for converting strings to numbers.
+ special cases:
+ undefined NaN
+ Null NaN
+ Boolean 1 if true; +0 if false
+ Number the argument ( no conversion )
+ String see test 9.3.1
+ Object see test 9.3-1
+
+
+ This tests ToNumber applied to the string type
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.3.1-1";
+var VERSION = "ECMA_1";
+var TITLE = "ToNumber applied to the String type";
+var BUGNUMBER="77391";
+
+startTest();
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+
+// StringNumericLiteral:::StrWhiteSpace:::StrWhiteSpaceChar StrWhiteSpace:::
+//
+// Name Unicode Value Escape Sequence
+// <TAB> 0X0009 \t
+// <SP> 0X0020
+// <FF> 0X000C \f
+// <VT> 0X000B
+// <CR> 0X000D \r
+// <LF> 0X000A \n
+new TestCase( SECTION, "Number('')", 0, Number("") );
+new TestCase( SECTION, "Number(' ')", 0, Number(" ") );
+new TestCase( SECTION, "Number(\\t)", 0, Number("\t") );
+new TestCase( SECTION, "Number(\\n)", 0, Number("\n") );
+new TestCase( SECTION, "Number(\\r)", 0, Number("\r") );
+new TestCase( SECTION, "Number(\\f)", 0, Number("\f") );
+
+new TestCase( SECTION, "Number(String.fromCharCode(0x0009)", 0, Number(String.fromCharCode(0x0009)) );
+new TestCase( SECTION, "Number(String.fromCharCode(0x0020)", 0, Number(String.fromCharCode(0x0020)) );
+new TestCase( SECTION, "Number(String.fromCharCode(0x000C)", 0, Number(String.fromCharCode(0x000C)) );
+new TestCase( SECTION, "Number(String.fromCharCode(0x000B)", 0, Number(String.fromCharCode(0x000B)) );
+new TestCase( SECTION, "Number(String.fromCharCode(0x000D)", 0, Number(String.fromCharCode(0x000D)) );
+new TestCase( SECTION, "Number(String.fromCharCode(0x000A)", 0, Number(String.fromCharCode(0x000A)) );
+
+// a StringNumericLiteral may be preceeded or followed by whitespace and/or
+// line terminators
+
+new TestCase( SECTION, "Number( ' ' + 999 )", 999, Number( ' '+999) );
+new TestCase( SECTION, "Number( '\\n' + 999 )", 999, Number( '\n' +999) );
+new TestCase( SECTION, "Number( '\\r' + 999 )", 999, Number( '\r' +999) );
+new TestCase( SECTION, "Number( '\\t' + 999 )", 999, Number( '\t' +999) );
+new TestCase( SECTION, "Number( '\\f' + 999 )", 999, Number( '\f' +999) );
+
+new TestCase( SECTION, "Number( 999 + ' ' )", 999, Number( 999+' ') );
+new TestCase( SECTION, "Number( 999 + '\\n' )", 999, Number( 999+'\n' ) );
+new TestCase( SECTION, "Number( 999 + '\\r' )", 999, Number( 999+'\r' ) );
+new TestCase( SECTION, "Number( 999 + '\\t' )", 999, Number( 999+'\t' ) );
+new TestCase( SECTION, "Number( 999 + '\\f' )", 999, Number( 999+'\f' ) );
+
+new TestCase( SECTION, "Number( '\\n' + 999 + '\\n' )", 999, Number( '\n' +999+'\n' ) );
+new TestCase( SECTION, "Number( '\\r' + 999 + '\\r' )", 999, Number( '\r' +999+'\r' ) );
+new TestCase( SECTION, "Number( '\\t' + 999 + '\\t' )", 999, Number( '\t' +999+'\t' ) );
+new TestCase( SECTION, "Number( '\\f' + 999 + '\\f' )", 999, Number( '\f' +999+'\f' ) );
+
+new TestCase( SECTION, "Number( ' ' + '999' )", 999, Number( ' '+'999') );
+new TestCase( SECTION, "Number( '\\n' + '999' )", 999, Number( '\n' +'999') );
+new TestCase( SECTION, "Number( '\\r' + '999' )", 999, Number( '\r' +'999') );
+new TestCase( SECTION, "Number( '\\t' + '999' )", 999, Number( '\t' +'999') );
+new TestCase( SECTION, "Number( '\\f' + '999' )", 999, Number( '\f' +'999') );
+
+new TestCase( SECTION, "Number( '999' + ' ' )", 999, Number( '999'+' ') );
+new TestCase( SECTION, "Number( '999' + '\\n' )", 999, Number( '999'+'\n' ) );
+new TestCase( SECTION, "Number( '999' + '\\r' )", 999, Number( '999'+'\r' ) );
+new TestCase( SECTION, "Number( '999' + '\\t' )", 999, Number( '999'+'\t' ) );
+new TestCase( SECTION, "Number( '999' + '\\f' )", 999, Number( '999'+'\f' ) );
+
+new TestCase( SECTION, "Number( '\\n' + '999' + '\\n' )", 999, Number( '\n' +'999'+'\n' ) );
+new TestCase( SECTION, "Number( '\\r' + '999' + '\\r' )", 999, Number( '\r' +'999'+'\r' ) );
+new TestCase( SECTION, "Number( '\\t' + '999' + '\\t' )", 999, Number( '\t' +'999'+'\t' ) );
+new TestCase( SECTION, "Number( '\\f' + '999' + '\\f' )", 999, Number( '\f' +'999'+'\f' ) );
+
+new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' )", 99, Number( String.fromCharCode(0x0009) + '99' ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' )", 99, Number( String.fromCharCode(0x0020) + '99' ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' )", 99, Number( String.fromCharCode(0x000C) + '99' ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' )", 99, Number( String.fromCharCode(0x000B) + '99' ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' )", 99, Number( String.fromCharCode(0x000D) + '99' ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' )", 99, Number( String.fromCharCode(0x000A) + '99' ) );
+
+new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) );
+
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0009)", 99, Number( '99' + String.fromCharCode(0x0009)) );
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0020)", 99, Number( '99' + String.fromCharCode(0x0020)) );
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000C)", 99, Number( '99' + String.fromCharCode(0x000C)) );
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000D)", 99, Number( '99' + String.fromCharCode(0x000D)) );
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000B)", 99, Number( '99' + String.fromCharCode(0x000B)) );
+new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000A)", 99, Number( '99' + String.fromCharCode(0x000A)) );
+
+new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 )", 99, Number( String.fromCharCode(0x0009) + 99 ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 )", 99, Number( String.fromCharCode(0x0020) + 99 ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 )", 99, Number( String.fromCharCode(0x000C) + 99 ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 )", 99, Number( String.fromCharCode(0x000B) + 99 ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 )", 99, Number( String.fromCharCode(0x000D) + 99 ) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 )", 99, Number( String.fromCharCode(0x000A) + 99 ) );
+
+new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) );
+new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) );
+
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0009)", 99, Number( 99 + String.fromCharCode(0x0009)) );
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0020)", 99, Number( 99 + String.fromCharCode(0x0020)) );
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000C)", 99, Number( 99 + String.fromCharCode(0x000C)) );
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000D)", 99, Number( 99 + String.fromCharCode(0x000D)) );
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000B)", 99, Number( 99 + String.fromCharCode(0x000B)) );
+new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000A)", 99, Number( 99 + String.fromCharCode(0x000A)) );
+
+
+// StrNumericLiteral:::StrDecimalLiteral:::Infinity
+
+new TestCase( SECTION, "Number('Infinity')", Math.pow(10,10000), Number("Infinity") );
+new TestCase( SECTION, "Number('-Infinity')", -Math.pow(10,10000), Number("-Infinity") );
+new TestCase( SECTION, "Number('+Infinity')", Math.pow(10,10000), Number("+Infinity") );
+
+// StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt
+
+new TestCase( SECTION, "Number('0')", 0, Number("0") );
+new TestCase( SECTION, "Number('-0')", -0, Number("-0") );
+new TestCase( SECTION, "Number('+0')", 0, Number("+0") );
+
+new TestCase( SECTION, "Number('1')", 1, Number("1") );
+new TestCase( SECTION, "Number('-1')", -1, Number("-1") );
+new TestCase( SECTION, "Number('+1')", 1, Number("+1") );
+
+new TestCase( SECTION, "Number('2')", 2, Number("2") );
+new TestCase( SECTION, "Number('-2')", -2, Number("-2") );
+new TestCase( SECTION, "Number('+2')", 2, Number("+2") );
+
+new TestCase( SECTION, "Number('3')", 3, Number("3") );
+new TestCase( SECTION, "Number('-3')", -3, Number("-3") );
+new TestCase( SECTION, "Number('+3')", 3, Number("+3") );
+
+new TestCase( SECTION, "Number('4')", 4, Number("4") );
+new TestCase( SECTION, "Number('-4')", -4, Number("-4") );
+new TestCase( SECTION, "Number('+4')", 4, Number("+4") );
+
+new TestCase( SECTION, "Number('5')", 5, Number("5") );
+new TestCase( SECTION, "Number('-5')", -5, Number("-5") );
+new TestCase( SECTION, "Number('+5')", 5, Number("+5") );
+
+new TestCase( SECTION, "Number('6')", 6, Number("6") );
+new TestCase( SECTION, "Number('-6')", -6, Number("-6") );
+new TestCase( SECTION, "Number('+6')", 6, Number("+6") );
+
+new TestCase( SECTION, "Number('7')", 7, Number("7") );
+new TestCase( SECTION, "Number('-7')", -7, Number("-7") );
+new TestCase( SECTION, "Number('+7')", 7, Number("+7") );
+
+new TestCase( SECTION, "Number('8')", 8, Number("8") );
+new TestCase( SECTION, "Number('-8')", -8, Number("-8") );
+new TestCase( SECTION, "Number('+8')", 8, Number("+8") );
+
+new TestCase( SECTION, "Number('9')", 9, Number("9") );
+new TestCase( SECTION, "Number('-9')", -9, Number("-9") );
+new TestCase( SECTION, "Number('+9')", 9, Number("+9") );
+
+new TestCase( SECTION, "Number('3.14159')", 3.14159, Number("3.14159") );
+new TestCase( SECTION, "Number('-3.14159')", -3.14159, Number("-3.14159") );
+new TestCase( SECTION, "Number('+3.14159')", 3.14159, Number("+3.14159") );
+
+new TestCase( SECTION, "Number('3.')", 3, Number("3.") );
+new TestCase( SECTION, "Number('-3.')", -3, Number("-3.") );
+new TestCase( SECTION, "Number('+3.')", 3, Number("+3.") );
+
+new TestCase( SECTION, "Number('3.e1')", 30, Number("3.e1") );
+new TestCase( SECTION, "Number('-3.e1')", -30, Number("-3.e1") );
+new TestCase( SECTION, "Number('+3.e1')", 30, Number("+3.e1") );
+
+new TestCase( SECTION, "Number('3.e+1')", 30, Number("3.e+1") );
+new TestCase( SECTION, "Number('-3.e+1')", -30, Number("-3.e+1") );
+new TestCase( SECTION, "Number('+3.e+1')", 30, Number("+3.e+1") );
+
+new TestCase( SECTION, "Number('3.e-1')", .30, Number("3.e-1") );
+new TestCase( SECTION, "Number('-3.e-1')", -.30, Number("-3.e-1") );
+new TestCase( SECTION, "Number('+3.e-1')", .30, Number("+3.e-1") );
+
+// StrDecimalLiteral::: .DecimalDigits ExponentPart opt
+
+new TestCase( SECTION, "Number('.00001')", 0.00001, Number(".00001") );
+new TestCase( SECTION, "Number('+.00001')", 0.00001, Number("+.00001") );
+new TestCase( SECTION, "Number('-0.0001')", -0.00001, Number("-.00001") );
+
+new TestCase( SECTION, "Number('.01e2')", 1, Number(".01e2") );
+new TestCase( SECTION, "Number('+.01e2')", 1, Number("+.01e2") );
+new TestCase( SECTION, "Number('-.01e2')", -1, Number("-.01e2") );
+
+new TestCase( SECTION, "Number('.01e+2')", 1, Number(".01e+2") );
+new TestCase( SECTION, "Number('+.01e+2')", 1, Number("+.01e+2") );
+new TestCase( SECTION, "Number('-.01e+2')", -1, Number("-.01e+2") );
+
+new TestCase( SECTION, "Number('.01e-2')", 0.0001, Number(".01e-2") );
+new TestCase( SECTION, "Number('+.01e-2')", 0.0001, Number("+.01e-2") );
+new TestCase( SECTION, "Number('-.01e-2')", -0.0001, Number("-.01e-2") );
+
+// StrDecimalLiteral::: DecimalDigits ExponentPart opt
+
+new TestCase( SECTION, "Number('1234e5')", 123400000, Number("1234e5") );
+new TestCase( SECTION, "Number('+1234e5')", 123400000, Number("+1234e5") );
+new TestCase( SECTION, "Number('-1234e5')", -123400000, Number("-1234e5") );
+
+new TestCase( SECTION, "Number('1234e+5')", 123400000, Number("1234e+5") );
+new TestCase( SECTION, "Number('+1234e+5')", 123400000, Number("+1234e+5") );
+new TestCase( SECTION, "Number('-1234e+5')", -123400000, Number("-1234e+5") );
+
+new TestCase( SECTION, "Number('1234e-5')", 0.01234, Number("1234e-5") );
+new TestCase( SECTION, "Number('+1234e-5')", 0.01234, Number("+1234e-5") );
+new TestCase( SECTION, "Number('-1234e-5')", -0.01234, Number("-1234e-5") );
+
+// StrNumericLiteral::: HexIntegerLiteral
+
+new TestCase( SECTION, "Number('0x0')", 0, Number("0x0"));
+new TestCase( SECTION, "Number('0x1')", 1, Number("0x1"));
+new TestCase( SECTION, "Number('0x2')", 2, Number("0x2"));
+new TestCase( SECTION, "Number('0x3')", 3, Number("0x3"));
+new TestCase( SECTION, "Number('0x4')", 4, Number("0x4"));
+new TestCase( SECTION, "Number('0x5')", 5, Number("0x5"));
+new TestCase( SECTION, "Number('0x6')", 6, Number("0x6"));
+new TestCase( SECTION, "Number('0x7')", 7, Number("0x7"));
+new TestCase( SECTION, "Number('0x8')", 8, Number("0x8"));
+new TestCase( SECTION, "Number('0x9')", 9, Number("0x9"));
+new TestCase( SECTION, "Number('0xa')", 10, Number("0xa"));
+new TestCase( SECTION, "Number('0xb')", 11, Number("0xb"));
+new TestCase( SECTION, "Number('0xc')", 12, Number("0xc"));
+new TestCase( SECTION, "Number('0xd')", 13, Number("0xd"));
+new TestCase( SECTION, "Number('0xe')", 14, Number("0xe"));
+new TestCase( SECTION, "Number('0xf')", 15, Number("0xf"));
+new TestCase( SECTION, "Number('0xA')", 10, Number("0xA"));
+new TestCase( SECTION, "Number('0xB')", 11, Number("0xB"));
+new TestCase( SECTION, "Number('0xC')", 12, Number("0xC"));
+new TestCase( SECTION, "Number('0xD')", 13, Number("0xD"));
+new TestCase( SECTION, "Number('0xE')", 14, Number("0xE"));
+new TestCase( SECTION, "Number('0xF')", 15, Number("0xF"));
+
+new TestCase( SECTION, "Number('0X0')", 0, Number("0X0"));
+new TestCase( SECTION, "Number('0X1')", 1, Number("0X1"));
+new TestCase( SECTION, "Number('0X2')", 2, Number("0X2"));
+new TestCase( SECTION, "Number('0X3')", 3, Number("0X3"));
+new TestCase( SECTION, "Number('0X4')", 4, Number("0X4"));
+new TestCase( SECTION, "Number('0X5')", 5, Number("0X5"));
+new TestCase( SECTION, "Number('0X6')", 6, Number("0X6"));
+new TestCase( SECTION, "Number('0X7')", 7, Number("0X7"));
+new TestCase( SECTION, "Number('0X8')", 8, Number("0X8"));
+new TestCase( SECTION, "Number('0X9')", 9, Number("0X9"));
+new TestCase( SECTION, "Number('0Xa')", 10, Number("0Xa"));
+new TestCase( SECTION, "Number('0Xb')", 11, Number("0Xb"));
+new TestCase( SECTION, "Number('0Xc')", 12, Number("0Xc"));
+new TestCase( SECTION, "Number('0Xd')", 13, Number("0Xd"));
+new TestCase( SECTION, "Number('0Xe')", 14, Number("0Xe"));
+new TestCase( SECTION, "Number('0Xf')", 15, Number("0Xf"));
+new TestCase( SECTION, "Number('0XA')", 10, Number("0XA"));
+new TestCase( SECTION, "Number('0XB')", 11, Number("0XB"));
+new TestCase( SECTION, "Number('0XC')", 12, Number("0XC"));
+new TestCase( SECTION, "Number('0XD')", 13, Number("0XD"));
+new TestCase( SECTION, "Number('0XE')", 14, Number("0XE"));
+new TestCase( SECTION, "Number('0XF')", 15, Number("0XF"));
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js
new file mode 100644
index 0000000000..911ec84b94
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js
@@ -0,0 +1,87 @@
+/* -*- 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 = '9.3.1-2.js';
+
+/**
+ File Name: 9.3.1-2.js
+ ECMA Section: 9.3 Type Conversion: ToNumber
+ Description: rules for converting an argument to a number.
+ see 9.3.1 for cases for converting strings to numbers.
+ special cases:
+ undefined NaN
+ Null NaN
+ Boolean 1 if true; +0 if false
+ Number the argument ( no conversion )
+ String see test 9.3.1
+ Object see test 9.3-1
+
+ This tests special cases of ToNumber(string) that are
+ not covered in 9.3.1-1.js.
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.3.1-2";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "ToNumber applied to the String type";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// A StringNumericLiteral may not use octal notation
+
+new TestCase( SECTION, "Number(00)", 0, Number("00"));
+new TestCase( SECTION, "Number(01)", 1, Number("01"));
+new TestCase( SECTION, "Number(02)", 2, Number("02"));
+new TestCase( SECTION, "Number(03)", 3, Number("03"));
+new TestCase( SECTION, "Number(04)", 4, Number("04"));
+new TestCase( SECTION, "Number(05)", 5, Number("05"));
+new TestCase( SECTION, "Number(06)", 6, Number("06"));
+new TestCase( SECTION, "Number(07)", 7, Number("07"));
+new TestCase( SECTION, "Number(010)", 10, Number("010"));
+new TestCase( SECTION, "Number(011)", 11, Number("011"));
+
+// A StringNumericLIteral may have any number of leading 0 digits
+
+new TestCase( SECTION, "Number(001)", 1, Number("001"));
+new TestCase( SECTION, "Number(0001)", 1, Number("0001"));
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
new file mode 100644
index 0000000000..dc56427395
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
@@ -0,0 +1,743 @@
+/* -*- 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 = '9.3.1-3.js';
+
+/**
+ File Name: 9.3.1-3.js
+ ECMA Section: 9.3 Type Conversion: ToNumber
+ Description: rules for converting an argument to a number.
+ see 9.3.1 for cases for converting strings to numbers.
+ special cases:
+ undefined NaN
+ Null NaN
+ Boolean 1 if true; +0 if false
+ Number the argument ( no conversion )
+ String see test 9.3.1
+ Object see test 9.3-1
+
+
+ Test cases provided by waldemar.
+
+
+ Author: christine@netscape.com
+ Date: 10 june 1998
+
+*/
+
+var SECTION = "9.3.1-3";
+var VERSION = "ECMA_1";
+var BUGNUMBER="129087";
+
+var TITLE = "Number To String, String To Number";
+
+startTest();
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// test case from http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312954
+var z = 0;
+
+new TestCase(
+ SECTION,
+ "var z = 0; print(1/-z)",
+ -Infinity,
+ 1/-z );
+
+
+
+
+
+// test cases from bug http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122882
+
+
+
+new TestCase( SECTION,
+ '- -"0x80000000"',
+ 2147483648,
+ - -"0x80000000" );
+
+new TestCase( SECTION,
+ '- -"0x100000000"',
+ 4294967296,
+ - -"0x100000000" );
+
+new TestCase( SECTION,
+ '- "-0x123456789abcde8"',
+ 81985529216486880,
+ - "-0x123456789abcde8" );
+
+// Convert some large numbers to string
+
+
+new TestCase( SECTION,
+ "1e2000 +''",
+ "Infinity",
+ 1e2000 +"" );
+
+new TestCase( SECTION,
+ "1e2000",
+ Infinity,
+ 1e2000 );
+
+new TestCase( SECTION,
+ "-1e2000 +''",
+ "-Infinity",
+ -1e2000 +"" );
+
+new TestCase( SECTION,
+ "-\"1e2000\"",
+ -Infinity,
+ -"1e2000" );
+
+new TestCase( SECTION,
+ "-\"-1e2000\" +''",
+ "Infinity",
+ -"-1e2000" +"" );
+
+new TestCase( SECTION,
+ "1e-2000",
+ 0,
+ 1e-2000 );
+
+new TestCase( SECTION,
+ "1/1e-2000",
+ Infinity,
+ 1/1e-2000 );
+
+// convert some strings to large numbers
+
+new TestCase( SECTION,
+ "1/-1e-2000",
+ -Infinity,
+ 1/-1e-2000 );
+
+new TestCase( SECTION,
+ "1/\"1e-2000\"",
+ Infinity,
+ 1/"1e-2000" );
+
+new TestCase( SECTION,
+ "1/\"-1e-2000\"",
+ -Infinity,
+ 1/"-1e-2000" );
+
+new TestCase( SECTION,
+ "parseFloat(\"1e2000\")",
+ Infinity,
+ parseFloat("1e2000") );
+
+new TestCase( SECTION,
+ "parseFloat(\"1e-2000\")",
+ 0,
+ parseFloat("1e-2000") );
+
+new TestCase( SECTION,
+ "1.7976931348623157E+308",
+ 1.7976931348623157e+308,
+ 1.7976931348623157E+308 );
+
+new TestCase( SECTION,
+ "1.7976931348623158e+308",
+ 1.7976931348623157e+308,
+ 1.7976931348623158e+308 );
+
+new TestCase( SECTION,
+ "1.7976931348623159e+308",
+ Infinity,
+ 1.7976931348623159e+308 );
+
+s =
+ "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068";
+
+print("s = " + s);
+print("-s = " + (-s));
+
+new TestCase( SECTION,
+ "s = " + s +"; s +="+
+ "\"190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779\""+
+
+ +"; s",
+ "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779",
+ s +=
+ "190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779"
+ );
+
+s1 = s+1;
+
+print("s1 = " + s1);
+print("-s1 = " + (-s1));
+
+new TestCase( SECTION,
+ "s1 = s+1; s1",
+ "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791",
+ s1 );
+
+/***** This answer is preferred but -Infinity is also acceptable here *****/
+
+new TestCase( SECTION,
+ "-s1 == Infinity || s1 == 1.7976931348623157e+308",
+ true,
+ -s1 == Infinity || s1 == 1.7976931348623157e+308 );
+
+s2 = s + 2;
+
+print("s2 = " + s2);
+print("-s2 = " + (-s2));
+
+new TestCase( SECTION,
+ "s2 = s+2; s2",
+ "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792",
+ s2 );
+
+// ***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here *****
+new TestCase( SECTION,
+ "-s2 == -Infinity || -s2 == -1.7976931348623157e+308 ",
+ true,
+ -s2 == -Infinity || -s2 == -1.7976931348623157e+308 );
+
+s3 = s+3;
+
+print("s3 = " + s3);
+print("-s3 = " + (-s3));
+
+new TestCase( SECTION,
+ "s3 = s+3; s3",
+ "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497793",
+ s3 );
+
+//***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here *****
+
+new TestCase( SECTION,
+ "-s3 == -Infinity || -s3 == -1.7976931348623157e+308",
+ true,
+ -s3 == -Infinity || -s3 == -1.7976931348623157e+308 );
+
+
+//***** This answer is preferred but Infinity is also acceptable here *****
+
+new TestCase( SECTION,
+ "parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity",
+ true,
+ parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity );
+
+//***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here *****
+new TestCase( SECTION,
+ "parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308",
+ true ,
+ parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308 );
+
+//***** This answer is preferred but Infinity is also acceptable here *****
+
+new TestCase( SECTION,
+ "parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity",
+ true,
+ parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity);
+
+//***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here *****
+new TestCase( SECTION,
+ "parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308",
+ true,
+ parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308 );
+
+new TestCase( SECTION,
+ "0x12345678",
+ 305419896,
+ 0x12345678 );
+
+new TestCase( SECTION,
+ "0x80000000",
+ 2147483648,
+ 0x80000000 );
+
+new TestCase( SECTION,
+ "0xffffffff",
+ 4294967295,
+ 0xffffffff );
+
+new TestCase( SECTION,
+ "0x100000000",
+ 4294967296,
+ 0x100000000 );
+
+new TestCase( SECTION,
+ "077777777777777777",
+ 2251799813685247,
+ 077777777777777777 );
+
+new TestCase( SECTION,
+ "077777777777777776",
+ 2251799813685246,
+ 077777777777777776 );
+
+new TestCase( SECTION,
+ "0x1fffffffffffff",
+ 9007199254740991,
+ 0x1fffffffffffff );
+
+new TestCase( SECTION,
+ "0x20000000000000",
+ 9007199254740992,
+ 0x20000000000000 );
+
+new TestCase( SECTION,
+ "0x20123456789abc",
+ 9027215253084860,
+ 0x20123456789abc );
+
+new TestCase( SECTION,
+ "0x20123456789abd",
+ 9027215253084860,
+ 0x20123456789abd );
+
+new TestCase( SECTION,
+ "0x20123456789abe",
+ 9027215253084862,
+ 0x20123456789abe );
+
+new TestCase( SECTION,
+ "0x20123456789abf",
+ 9027215253084864,
+ 0x20123456789abf );
+
+/***** These test the round-to-nearest-or-even-if-equally-close rule *****/
+
+new TestCase( SECTION,
+ "0x1000000000000080",
+ 1152921504606847000,
+ 0x1000000000000080 );
+
+new TestCase( SECTION,
+ "0x1000000000000081",
+ 1152921504606847200,
+ 0x1000000000000081 );
+
+new TestCase( SECTION,
+ "0x1000000000000100",
+ 1152921504606847200,
+ 0x1000000000000100 );
+new TestCase( SECTION,
+ "0x100000000000017f",
+ 1152921504606847200,
+ 0x100000000000017f );
+
+new TestCase( SECTION,
+ "0x1000000000000180",
+ 1152921504606847500,
+ 0x1000000000000180 );
+
+new TestCase( SECTION,
+ "0x1000000000000181",
+ 1152921504606847500,
+ 0x1000000000000181 );
+
+new TestCase( SECTION,
+ "0x10000000000001f0",
+ 1152921504606847500,
+ 0x10000000000001f0 );
+
+new TestCase( SECTION,
+ "0x1000000000000200",
+ 1152921504606847500,
+ 0x1000000000000200 );
+
+new TestCase( SECTION,
+ "0x100000000000027f",
+ 1152921504606847500,
+ 0x100000000000027f );
+
+new TestCase( SECTION,
+ "0x1000000000000280",
+ 1152921504606847500,
+ 0x1000000000000280 );
+
+new TestCase( SECTION,
+ "0x1000000000000281",
+ 1152921504606847700,
+ 0x1000000000000281 );
+
+new TestCase( SECTION,
+ "0x10000000000002ff",
+ 1152921504606847700,
+ 0x10000000000002ff );
+
+new TestCase( SECTION,
+ "0x1000000000000300",
+ 1152921504606847700,
+ 0x1000000000000300 );
+
+new TestCase( SECTION,
+ "0x10000000000000000",
+ 18446744073709552000,
+ 0x10000000000000000 );
+
+new TestCase( SECTION,
+ "parseInt(\"000000100000000100100011010001010110011110001001101010111100\",2)",
+ 9027215253084860,
+ parseInt("000000100000000100100011010001010110011110001001101010111100",2) );
+
+new TestCase( SECTION,
+ "parseInt(\"000000100000000100100011010001010110011110001001101010111101\",2)",
+ 9027215253084860,
+ parseInt("000000100000000100100011010001010110011110001001101010111101",2) );
+
+new TestCase( SECTION,
+ "parseInt(\"000000100000000100100011010001010110011110001001101010111111\",2)",
+ 9027215253084864,
+ parseInt("000000100000000100100011010001010110011110001001101010111111",2) );
+
+new TestCase( SECTION,
+ "parseInt(\"0000001000000001001000110100010101100111100010011010101111010\",2)",
+ 18054430506169720,
+ parseInt("0000001000000001001000110100010101100111100010011010101111010",2));
+
+new TestCase( SECTION,
+ "parseInt(\"0000001000000001001000110100010101100111100010011010101111011\",2)",
+ 18054430506169724,
+ parseInt("0000001000000001001000110100010101100111100010011010101111011",2) );
+
+new TestCase( SECTION,
+ "parseInt(\"0000001000000001001000110100010101100111100010011010101111100\",2)",
+ 18054430506169724,
+ parseInt("0000001000000001001000110100010101100111100010011010101111100",2));
+
+new TestCase( SECTION,
+ "parseInt(\"0000001000000001001000110100010101100111100010011010101111110\",2)",
+ 18054430506169728,
+ parseInt("0000001000000001001000110100010101100111100010011010101111110",2));
+
+new TestCase( SECTION,
+ "parseInt(\"yz\",35)",
+ 34,
+ parseInt("yz",35) );
+
+new TestCase( SECTION,
+ "parseInt(\"yz\",36)",
+ 1259,
+ parseInt("yz",36) );
+
+new TestCase( SECTION,
+ "parseInt(\"yz\",37)",
+ NaN,
+ parseInt("yz",37) );
+
+new TestCase( SECTION,
+ "parseInt(\"+77\")",
+ 77,
+ parseInt("+77") );
+
+new TestCase( SECTION,
+ "parseInt(\"-77\",9)",
+ -70,
+ parseInt("-77",9) );
+
+new TestCase( SECTION,
+ "parseInt(\"\\u20001234\\u2000\")",
+ 1234,
+ parseInt("\u20001234\u2000") );
+
+new TestCase( SECTION,
+ "parseInt(\"123456789012345678\")",
+ 123456789012345680,
+ parseInt("123456789012345678") );
+
+new TestCase( SECTION,
+ "parseInt(\"9\",8)",
+ NaN,
+ parseInt("9",8) );
+
+new TestCase( SECTION,
+ "parseInt(\"1e2\")",
+ 1,
+ parseInt("1e2") );
+
+new TestCase( SECTION,
+ "parseInt(\"1.9999999999999999999\")",
+ 1,
+ parseInt("1.9999999999999999999") );
+
+new TestCase( SECTION,
+ "parseInt(\"0x10\")",
+ 16,
+ parseInt("0x10") );
+
+new TestCase( SECTION,
+ "parseInt(\"0x10\",10)",
+ 0,
+ parseInt("0x10",10) );
+
+new TestCase( SECTION,
+ "parseInt(\"0022\")",
+ 18,
+ parseInt("0022") );
+
+new TestCase( SECTION,
+ "parseInt(\"0022\",10)",
+ 22,
+ parseInt("0022",10) );
+
+new TestCase( SECTION,
+ "parseInt(\"0x1000000000000080\")",
+ 1152921504606847000,
+ parseInt("0x1000000000000080") );
+
+new TestCase( SECTION,
+ "parseInt(\"0x1000000000000081\")",
+ 1152921504606847200,
+ parseInt("0x1000000000000081") );
+
+s =
+ "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+new TestCase( SECTION, "s = "+
+ "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
+ "s",
+ "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s );
+
+
+new TestCase( SECTION, "s +="+
+ "\"0000000000000000000000000000000000000\"; s",
+ "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s += "0000000000000000000000000000000000000" );
+
+new TestCase( SECTION, "-s",
+ -1.7976931348623157e+308,
+ -s );
+
+s =
+ "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+new TestCase( SECTION, "s ="+
+ "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
+ "s",
+ "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s );
+
+new TestCase( SECTION,
+ "s += \"0000000000000000000000000000000000001\"",
+ "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
+ s += "0000000000000000000000000000000000001" );
+
+new TestCase( SECTION,
+ "-s",
+ -1.7976931348623157e+308,
+ -s );
+
+s =
+ "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+new TestCase( SECTION,
+ "s ="+
+ "\"0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
+ "s",
+ "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s );
+
+
+new TestCase( SECTION,
+ "s += \"0000000000000000000000000000000000000\"",
+ "0xFFFFFFFFFFFFFC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s += "0000000000000000000000000000000000000");
+
+
+new TestCase( SECTION,
+ "-s",
+ -Infinity,
+ -s );
+
+s =
+ "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+new TestCase( SECTION,
+ "s = "+
+ "\"0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";s",
+ "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ s);
+
+new TestCase( SECTION,
+ "s += \"0000000000000000000000000000000000001\"",
+ "0xFFFFFFFFFFFFFB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
+ s += "0000000000000000000000000000000000001" );
+
+new TestCase( SECTION,
+ "-s",
+ -1.7976931348623157e+308,
+ -s );
+
+new TestCase( SECTION,
+ "s += \"0\"",
+ "0xFFFFFFFFFFFFFB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010",
+ s += "0" );
+
+new TestCase( SECTION,
+ "-s",
+ -Infinity,
+ -s );
+
+new TestCase( SECTION,
+ "parseInt(s)",
+ Infinity,
+ parseInt(s) );
+
+new TestCase( SECTION,
+ "parseInt(s,32)",
+ 0,
+ parseInt(s,32) );
+
+new TestCase( SECTION,
+ "parseInt(s,36)",
+ Infinity,
+ parseInt(s,36) );
+
+new TestCase( SECTION,
+ "-\"\"",
+ 0,
+ -"" );
+
+new TestCase( SECTION,
+ "-\" \"",
+ 0,
+ -" " );
+
+new TestCase( SECTION,
+ "-\"999\"",
+ -999,
+ -"999" );
+
+new TestCase( SECTION,
+ "-\" 999\"",
+ -999,
+ -" 999" );
+
+new TestCase( SECTION,
+ "-\"\\t999\"",
+ -999,
+ -"\t999" );
+
+new TestCase( SECTION,
+ "-\"013 \"",
+ -13,
+ -"013 " );
+
+new TestCase( SECTION,
+ "-\"999\\t\"",
+ -999,
+ -"999\t" );
+
+new TestCase( SECTION,
+ "-\"-Infinity\"",
+ Infinity,
+ -"-Infinity" );
+
+new TestCase( SECTION,
+ "-\"-infinity\"",
+ NaN,
+ -"-infinity" );
+
+
+new TestCase( SECTION,
+ "-\"+Infinity\"",
+ -Infinity,
+ -"+Infinity" );
+
+new TestCase( SECTION,
+ "-\"+Infiniti\"",
+ NaN,
+ -"+Infiniti" );
+
+new TestCase( SECTION,
+ "- -\"0x80000000\"",
+ 2147483648,
+ - -"0x80000000" );
+
+new TestCase( SECTION,
+ "- -\"0x100000000\"",
+ 4294967296,
+ - -"0x100000000" );
+
+new TestCase( SECTION,
+ "- \"-0x123456789abcde8\"",
+ 81985529216486880,
+ - "-0x123456789abcde8" );
+
+// the following two tests are not strictly ECMA 1.0
+
+new TestCase( SECTION,
+ "-\"\\u20001234\\u2001\"",
+ -1234,
+ -"\u20001234\u2001" );
+
+new TestCase( SECTION,
+ "-\"\\u20001234\\0\"",
+ NaN,
+ -"\u20001234\0" );
+
+new TestCase( SECTION,
+ "-\"0x10\"",
+ -16,
+ -"0x10" );
+
+new TestCase( SECTION,
+ "-\"+\"",
+ NaN,
+ -"+" );
+
+new TestCase( SECTION,
+ "-\"-\"",
+ NaN,
+ -"-" );
+
+new TestCase( SECTION,
+ "-\"-0-\"",
+ NaN,
+ -"-0-" );
+
+new TestCase( SECTION,
+ "-\"1e-\"",
+ NaN,
+ -"1e-" );
+
+new TestCase( SECTION,
+ "-\"1e-1\"",
+ -0.1,
+ -"1e-1" );
+
+test();
+
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js
new file mode 100644
index 0000000000..c4b866e7f3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js
@@ -0,0 +1,87 @@
+/* -*- 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 = '9.3.js';
+
+/**
+ File Name: 9.3.js
+ ECMA Section: 9.3 Type Conversion: ToNumber
+ Description: rules for converting an argument to a number.
+ see 9.3.1 for cases for converting strings to numbers.
+ special cases:
+ undefined NaN
+ Null NaN
+ Boolean 1 if true; +0 if false
+ Number the argument ( no conversion )
+ String see test 9.3.1
+ Object see test 9.3-1
+
+ For ToNumber applied to the String type, see test 9.3.1.
+ For ToNumber applied to the object type, see test 9.3-1.
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.3";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "ToNumber";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// special cases here
+
+new TestCase( SECTION, "Number()", 0, Number() );
+new TestCase( SECTION, "Number(eval('var x'))", Number.NaN, Number(eval("var x")) );
+new TestCase( SECTION, "Number(void 0)", Number.NaN, Number(void 0) );
+new TestCase( SECTION, "Number(null)", 0, Number(null) );
+new TestCase( SECTION, "Number(true)", 1, Number(true) );
+new TestCase( SECTION, "Number(false)", 0, Number(false) );
+new TestCase( SECTION, "Number(0)", 0, Number(0) );
+new TestCase( SECTION, "Number(-0)", -0, Number(-0) );
+new TestCase( SECTION, "Number(1)", 1, Number(1) );
+new TestCase( SECTION, "Number(-1)", -1, Number(-1) );
+new TestCase( SECTION, "Number(Number.MAX_VALUE)", 1.7976931348623157e308, Number(Number.MAX_VALUE) );
+new TestCase( SECTION, "Number(Number.MIN_VALUE)", 5e-324, Number(Number.MIN_VALUE) );
+
+new TestCase( SECTION, "Number(Number.NaN)", Number.NaN, Number(Number.NaN) );
+new TestCase( SECTION, "Number(Number.POSITIVE_INFINITY)", Number.POSITIVE_INFINITY, Number(Number.POSITIVE_INFINITY) );
+new TestCase( SECTION, "Number(Number.NEGATIVE_INFINITY)", Number.NEGATIVE_INFINITY, Number(Number.NEGATIVE_INFINITY) );
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js
new file mode 100644
index 0000000000..e99875697a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.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 = '9.4-1.js';
+
+/**
+ File Name: 9.4-1.js
+ ECMA Section: 9.4 ToInteger
+ Description: 1. Call ToNumber on the input argument
+ 2. If Result(1) is NaN, return +0
+ 3. If Result(1) is +0, -0, Infinity, or -Infinity,
+ return Result(1).
+ 4. Compute sign(Result(1)) * floor(abs(Result(1))).
+ 5. Return Result(4).
+
+ To test ToInteger, this test uses new Date(value),
+ 15.9.3.7. The Date constructor sets the [[Value]]
+ property of the new object to TimeClip(value), which
+ uses the rules:
+
+ TimeClip(time)
+ 1. If time is not finite, return NaN
+ 2. If abs(Result(1)) > 8.64e15, return NaN
+ 3. Return an implementation dependent choice of either
+ ToInteger(Result(2)) or ToInteger(Result(2)) + (+0)
+ (Adding a positive 0 converts -0 to +0).
+
+ This tests ToInteger for values -8.64e15 > value > 8.64e15,
+ not including -0 and +0.
+
+ For additional special cases (0, +0, Infinity, -Infinity,
+ and NaN, see 9.4-2.js). For value is String, see 9.4-3.js.
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.4-1";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "ToInteger";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// some special cases
+
+new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, eval("td = new Date(Number.NaN); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.POSITIVE_INFINITY); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.NEGATIVE_INFINITY); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, eval("td = new Date(-0); td.valueOf()" ) );
+new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, eval("td = new Date(0); td.valueOf()") );
+
+// value is not an integer
+
+new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, eval("td = new Date(3.14159); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, eval("td = new Date(Math.PI); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, eval("td = new Date(-Math.PI);td.valueOf()") );
+new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, eval("td = new Date(3.14159e2); td.valueOf()") );
+
+new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, eval("td = new Date(.692147e1);td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, eval("td = new Date(-.692147e1);td.valueOf()") );
+
+// value is not a number
+
+new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, eval("td = new Date(true); td.valueOf()" ) );
+new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, eval("td = new Date(false); td.valueOf()") );
+
+new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") );
+
+// edge cases
+new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, eval("td = new Date(8.64e15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, eval("td = new Date(-8.64e15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, eval("td = new Date(8.64e-15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, eval("td = new Date(-8.64e-15); td.valueOf()") );
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js
new file mode 100644
index 0000000000..9b26a67fac
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.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 = '9.4-2.js';
+
+/**
+ File Name: 9.4-1.js
+ ECMA Section: 9.4 ToInteger
+ Description: 1. Call ToNumber on the input argument
+ 2. If Result(1) is NaN, return +0
+ 3. If Result(1) is +0, -0, Infinity, or -Infinity,
+ return Result(1).
+ 4. Compute sign(Result(1)) * floor(abs(Result(1))).
+ 5. Return Result(4).
+
+ To test ToInteger, this test uses new Date(value),
+ 15.9.3.7. The Date constructor sets the [[Value]]
+ property of the new object to TimeClip(value), which
+ uses the rules:
+
+ TimeClip(time)
+ 1. If time is not finite, return NaN
+ 2. If abs(Result(1)) > 8.64e15, return NaN
+ 3. Return an implementation dependent choice of either
+ ToInteger(Result(2)) or ToInteger(Result(2)) + (+0)
+ (Adding a positive 0 converts -0 to +0).
+
+ This tests ToInteger for values -8.64e15 > value > 8.64e15,
+ not including -0 and +0.
+
+ For additional special cases (0, +0, Infinity, -Infinity,
+ and NaN, see 9.4-2.js). For value is String, see 9.4-3.js.
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+
+*/
+var SECTION = "9.4-1";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "ToInteger";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// some special cases
+
+new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, eval("td = new Date(Number.NaN); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.POSITIVE_INFINITY); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.NEGATIVE_INFINITY); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, eval("td = new Date(-0); td.valueOf()" ) );
+new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, eval("td = new Date(0); td.valueOf()") );
+
+// value is not an integer
+
+new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, eval("td = new Date(3.14159); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, eval("td = new Date(Math.PI); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, eval("td = new Date(-Math.PI);td.valueOf()") );
+new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, eval("td = new Date(3.14159e2); td.valueOf()") );
+
+new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, eval("td = new Date(.692147e1);td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, eval("td = new Date(-.692147e1);td.valueOf()") );
+
+// value is not a number
+
+new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, eval("td = new Date(true); td.valueOf()" ) );
+new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, eval("td = new Date(false); td.valueOf()") );
+
+new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") );
+
+// edge cases
+new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, eval("td = new Date(8.64e15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, eval("td = new Date(-8.64e15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, eval("td = new Date(8.64e-15); td.valueOf()") );
+new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, eval("td = new Date(-8.64e-15); td.valueOf()") );
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js
new file mode 100644
index 0000000000..2773052340
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js
@@ -0,0 +1,173 @@
+/* -*- 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 = '9.5-2.js';
+
+/**
+ File Name: 9.5-2.js
+ ECMA Section: 9.5 Type Conversion: ToInt32
+ Description: rules for converting an argument to a signed 32 bit integer
+
+ this test uses << 0 to convert the argument to a 32bit
+ integer.
+
+ The operator ToInt32 converts its argument to one of 2^32
+ integer values in the range -2^31 through 2^31 inclusive.
+ This operator functions as follows:
+
+ 1 call ToNumber on argument
+ 2 if result is NaN, 0, -0, return 0
+ 3 compute (sign (result(1)) * floor(abs(result 1)))
+ 4 compute result(3) modulo 2^32:
+ 5 if result(4) is greater than or equal to 2^31, return
+ result(5)-2^32. otherwise, return result(5)
+
+ special cases:
+ -0 returns 0
+ Infinity returns 0
+ -Infinity returns 0
+ ToInt32(ToUint32(x)) == ToInt32(x) for all values of x
+ Numbers greater than 2^31 (see step 5 above)
+ (note http://bugzilla.mozilla.org/show_bug.cgi?id=120083)
+
+ Author: christine@netscape.com
+ Date: 17 july 1997
+*/
+var SECTION = "9.5-2";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " ToInt32");
+
+new TestCase( SECTION, "0 << 0", 0, 0 << 0 );
+new TestCase( SECTION, "-0 << 0", 0, -0 << 0 );
+new TestCase( SECTION, "Infinity << 0", 0, "Infinity" << 0 );
+new TestCase( SECTION, "-Infinity << 0", 0, "-Infinity" << 0 );
+new TestCase( SECTION, "Number.POSITIVE_INFINITY << 0", 0, Number.POSITIVE_INFINITY << 0 );
+new TestCase( SECTION, "Number.NEGATIVE_INFINITY << 0", 0, Number.NEGATIVE_INFINITY << 0 );
+new TestCase( SECTION, "Number.NaN << 0", 0, Number.NaN << 0 );
+
+new TestCase( SECTION, "Number.MIN_VALUE << 0", 0, Number.MIN_VALUE << 0 );
+new TestCase( SECTION, "-Number.MIN_VALUE << 0", 0, -Number.MIN_VALUE << 0 );
+new TestCase( SECTION, "0.1 << 0", 0, 0.1 << 0 );
+new TestCase( SECTION, "-0.1 << 0", 0, -0.1 << 0 );
+new TestCase( SECTION, "1 << 0", 1, 1 << 0 );
+new TestCase( SECTION, "1.1 << 0", 1, 1.1 << 0 );
+new TestCase( SECTION, "-1 << 0", ToInt32(-1), -1 << 0 );
+
+
+new TestCase( SECTION, "2147483647 << 0", ToInt32(2147483647), 2147483647 << 0 );
+new TestCase( SECTION, "2147483648 << 0", ToInt32(2147483648), 2147483648 << 0 );
+new TestCase( SECTION, "2147483649 << 0", ToInt32(2147483649), 2147483649 << 0 );
+
+new TestCase( SECTION, "(Math.pow(2,31)-1) << 0", ToInt32(2147483647), (Math.pow(2,31)-1) << 0 );
+new TestCase( SECTION, "Math.pow(2,31) << 0", ToInt32(2147483648), Math.pow(2,31) << 0 );
+new TestCase( SECTION, "(Math.pow(2,31)+1) << 0", ToInt32(2147483649), (Math.pow(2,31)+1) << 0 );
+
+new TestCase( SECTION, "(Math.pow(2,32)-1) << 0", ToInt32(4294967295), (Math.pow(2,32)-1) << 0 );
+new TestCase( SECTION, "(Math.pow(2,32)) << 0", ToInt32(4294967296), (Math.pow(2,32)) << 0 );
+new TestCase( SECTION, "(Math.pow(2,32)+1) << 0", ToInt32(4294967297), (Math.pow(2,32)+1) << 0 );
+
+new TestCase( SECTION, "4294967295 << 0", ToInt32(4294967295), 4294967295 << 0 );
+new TestCase( SECTION, "4294967296 << 0", ToInt32(4294967296), 4294967296 << 0 );
+new TestCase( SECTION, "4294967297 << 0", ToInt32(4294967297), 4294967297 << 0 );
+
+new TestCase( SECTION, "'2147483647' << 0", ToInt32(2147483647), '2147483647' << 0 );
+new TestCase( SECTION, "'2147483648' << 0", ToInt32(2147483648), '2147483648' << 0 );
+new TestCase( SECTION, "'2147483649' << 0", ToInt32(2147483649), '2147483649' << 0 );
+
+new TestCase( SECTION, "'4294967295' << 0", ToInt32(4294967295), '4294967295' << 0 );
+new TestCase( SECTION, "'4294967296' << 0", ToInt32(4294967296), '4294967296' << 0 );
+new TestCase( SECTION, "'4294967297' << 0", ToInt32(4294967297), '4294967297' << 0 );
+
+new TestCase( SECTION, "-2147483647 << 0", ToInt32(-2147483647), -2147483647 << 0 );
+new TestCase( SECTION, "-2147483648 << 0", ToInt32(-2147483648), -2147483648 << 0 );
+new TestCase( SECTION, "-2147483649 << 0", ToInt32(-2147483649), -2147483649 << 0 );
+
+new TestCase( SECTION, "-4294967295 << 0", ToInt32(-4294967295), -4294967295 << 0 );
+new TestCase( SECTION, "-4294967296 << 0", ToInt32(-4294967296), -4294967296 << 0 );
+new TestCase( SECTION, "-4294967297 << 0", ToInt32(-4294967297), -4294967297 << 0 );
+
+/*
+ * Numbers between 2^31 and 2^32 will have a negative ToInt32 per ECMA (see step 5 of introduction)
+ * (These are by stevechapel@earthlink.net; cf. http://bugzilla.mozilla.org/show_bug.cgi?id=120083)
+ */
+new TestCase( SECTION, "2147483648.25 << 0", ToInt32(2147483648.25), 2147483648.25 << 0 );
+new TestCase( SECTION, "2147483648.5 << 0", ToInt32(2147483648.5), 2147483648.5 << 0 );
+new TestCase( SECTION, "2147483648.75 << 0", ToInt32(2147483648.75), 2147483648.75 << 0 );
+new TestCase( SECTION, "4294967295.25 << 0", ToInt32(4294967295.25), 4294967295.25 << 0 );
+new TestCase( SECTION, "4294967295.5 << 0", ToInt32(4294967295.5), 4294967295.5 << 0 );
+new TestCase( SECTION, "4294967295.75 << 0", ToInt32(4294967295.75), 4294967295.75 << 0 );
+new TestCase( SECTION, "3000000000.25 << 0", ToInt32(3000000000.25), 3000000000.25 << 0 );
+new TestCase( SECTION, "3000000000.5 << 0", ToInt32(3000000000.5), 3000000000.5 << 0 );
+new TestCase( SECTION, "3000000000.75 << 0", ToInt32(3000000000.75), 3000000000.75 << 0 );
+
+/*
+ * Numbers between - 2^31 and - 2^32
+ */
+new TestCase( SECTION, "-2147483648.25 << 0", ToInt32(-2147483648.25), -2147483648.25 << 0 );
+new TestCase( SECTION, "-2147483648.5 << 0", ToInt32(-2147483648.5), -2147483648.5 << 0 );
+new TestCase( SECTION, "-2147483648.75 << 0", ToInt32(-2147483648.75), -2147483648.75 << 0 );
+new TestCase( SECTION, "-4294967295.25 << 0", ToInt32(-4294967295.25), -4294967295.25 << 0 );
+new TestCase( SECTION, "-4294967295.5 << 0", ToInt32(-4294967295.5), -4294967295.5 << 0 );
+new TestCase( SECTION, "-4294967295.75 << 0", ToInt32(-4294967295.75), -4294967295.75 << 0 );
+new TestCase( SECTION, "-3000000000.25 << 0", ToInt32(-3000000000.25), -3000000000.25 << 0 );
+new TestCase( SECTION, "-3000000000.5 << 0", ToInt32(-3000000000.5), -3000000000.5 << 0 );
+new TestCase( SECTION, "-3000000000.75 << 0", ToInt32(-3000000000.75), -3000000000.75 << 0 );
+
+
+test();
+
+function ToInt32( n ) {
+ n = Number( n );
+ var sign = ( n < 0 ) ? -1 : 1;
+
+ if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
+ return 0;
+ }
+
+ n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32);
+ if ( sign == -1 ) {
+ n = ( n < -Math.pow(2,31) ) ? n + Math.pow(2,32) : n;
+ } else{
+ n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n;
+ }
+
+ return ( n );
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js
new file mode 100644
index 0000000000..3d958b3f9d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js
@@ -0,0 +1,140 @@
+/* -*- 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 = '9.6.js';
+
+/**
+ File Name: 9.6.js
+ ECMA Section: 9.6 Type Conversion: ToUint32
+ Description: rules for converting an argument to an unsigned
+ 32 bit integer
+
+ this test uses >>> 0 to convert the argument to
+ an unsigned 32bit integer.
+
+ 1 call ToNumber on argument
+ 2 if result is NaN, 0, -0, Infinity, -Infinity
+ return 0
+ 3 compute (sign (result(1)) * floor(abs(result 1)))
+ 4 compute result(3) modulo 2^32:
+ 5 return result(4)
+
+ special cases:
+ -0 returns 0
+ Infinity returns 0
+ -Infinity returns 0
+ 0 returns 0
+ ToInt32(ToUint32(x)) == ToInt32(x) for all values of x
+ ** NEED TO DO THIS PART IN A SEPARATE TEST FILE **
+
+
+ Author: christine@netscape.com
+ Date: 17 july 1997
+*/
+
+var SECTION = "9.6";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Type Conversion: ToUint32");
+
+new TestCase( SECTION, "0 >>> 0", 0, 0 >>> 0 );
+// new TestCase( SECTION, "+0 >>> 0", 0, +0 >>> 0);
+new TestCase( SECTION, "-0 >>> 0", 0, -0 >>> 0 );
+new TestCase( SECTION, "'Infinity' >>> 0", 0, "Infinity" >>> 0 );
+new TestCase( SECTION, "'-Infinity' >>> 0", 0, "-Infinity" >>> 0);
+new TestCase( SECTION, "'+Infinity' >>> 0", 0, "+Infinity" >>> 0 );
+new TestCase( SECTION, "Number.POSITIVE_INFINITY >>> 0", 0, Number.POSITIVE_INFINITY >>> 0 );
+new TestCase( SECTION, "Number.NEGATIVE_INFINITY >>> 0", 0, Number.NEGATIVE_INFINITY >>> 0 );
+new TestCase( SECTION, "Number.NaN >>> 0", 0, Number.NaN >>> 0 );
+
+new TestCase( SECTION, "Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 );
+new TestCase( SECTION, "-Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 );
+new TestCase( SECTION, "0.1 >>> 0", 0, 0.1 >>> 0 );
+new TestCase( SECTION, "-0.1 >>> 0", 0, -0.1 >>> 0 );
+new TestCase( SECTION, "1 >>> 0", 1, 1 >>> 0 );
+new TestCase( SECTION, "1.1 >>> 0", 1, 1.1 >>> 0 );
+
+new TestCase( SECTION, "-1.1 >>> 0", ToUint32(-1.1), -1.1 >>> 0 );
+new TestCase( SECTION, "-1 >>> 0", ToUint32(-1), -1 >>> 0 );
+
+new TestCase( SECTION, "2147483647 >>> 0", ToUint32(2147483647), 2147483647 >>> 0 );
+new TestCase( SECTION, "2147483648 >>> 0", ToUint32(2147483648), 2147483648 >>> 0 );
+new TestCase( SECTION, "2147483649 >>> 0", ToUint32(2147483649), 2147483649 >>> 0 );
+
+new TestCase( SECTION, "4294967295 >>> 0", ToUint32(4294967295), 4294967295 >>> 0 );
+new TestCase( SECTION, "4294967296 >>> 0", ToUint32(4294967296), 4294967296 >>> 0 );
+new TestCase( SECTION, "4294967297 >>> 0", ToUint32(4294967297), 4294967297 >>> 0 );
+
+new TestCase( SECTION, "-2147483647 >>> 0", ToUint32(-2147483647), -2147483647 >>> 0 );
+new TestCase( SECTION, "-2147483648 >>> 0", ToUint32(-2147483648), -2147483648 >>> 0 );
+new TestCase( SECTION, "-2147483649 >>> 0", ToUint32(-2147483649), -2147483649 >>> 0 );
+
+new TestCase( SECTION, "-4294967295 >>> 0", ToUint32(-4294967295), -4294967295 >>> 0 );
+new TestCase( SECTION, "-4294967296 >>> 0", ToUint32(-4294967296), -4294967296 >>> 0 );
+new TestCase( SECTION, "-4294967297 >>> 0", ToUint32(-4294967297), -4294967297 >>> 0 );
+
+new TestCase( SECTION, "'2147483647' >>> 0", ToUint32(2147483647), '2147483647' >>> 0 );
+new TestCase( SECTION, "'2147483648' >>> 0", ToUint32(2147483648), '2147483648' >>> 0 );
+new TestCase( SECTION, "'2147483649' >>> 0", ToUint32(2147483649), '2147483649' >>> 0 );
+
+new TestCase( SECTION, "'4294967295' >>> 0", ToUint32(4294967295), '4294967295' >>> 0 );
+new TestCase( SECTION, "'4294967296' >>> 0", ToUint32(4294967296), '4294967296' >>> 0 );
+new TestCase( SECTION, "'4294967297' >>> 0", ToUint32(4294967297), '4294967297' >>> 0 );
+
+
+test();
+
+function ToUint32( n ) {
+ n = Number( n );
+ var sign = ( n < 0 ) ? -1 : 1;
+
+ if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
+ return 0;
+ }
+ n = sign * Math.floor( Math.abs(n) )
+
+ n = n % Math.pow(2,32);
+
+ if ( n < 0 ){
+ n += Math.pow(2,32);
+ }
+
+ return ( n );
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js
new file mode 100644
index 0000000000..34e4857fd7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js
@@ -0,0 +1,160 @@
+/* -*- 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 = '9.7.js';
+
+/**
+ File Name: 9.7.js
+ ECMA Section: 9.7 Type Conversion: ToInt16
+ Description: rules for converting an argument to an unsigned
+ 16 bit integer in the range 0 to 2^16-1.
+
+ this test uses String.prototype.fromCharCode() and
+ String.prototype.charCodeAt() to test ToInt16.
+
+ special cases:
+ -0 returns 0
+ Infinity returns 0
+ -Infinity returns 0
+ 0 returns 0
+
+ Author: christine@netscape.com
+ Date: 17 july 1997
+*/
+var SECTION = "9.7";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " Type Conversion: ToInt16");
+
+/*
+ new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", 0, String.fromCharCode(0).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", 0, String.fromCharCode(-0).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", 1, String.fromCharCode(1).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", 64, String.fromCharCode(64).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", 126, String.fromCharCode(126).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", 127, String.fromCharCode(127).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", 128, String.fromCharCode(128).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", 130, String.fromCharCode(130).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", 255, String.fromCharCode(255).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", 256, String.fromCharCode(256).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) );
+ new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) );
+*/
+
+
+new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", ToInt16(0), String.fromCharCode(0).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", ToInt16(0), String.fromCharCode(-0).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", ToInt16(1), String.fromCharCode(1).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", ToInt16(64), String.fromCharCode(64).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", ToInt16(126), String.fromCharCode(126).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", ToInt16(127), String.fromCharCode(127).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", ToInt16(128), String.fromCharCode(128).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", ToInt16(130), String.fromCharCode(130).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", ToInt16(255), String.fromCharCode(255).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", ToInt16(256), String.fromCharCode(256).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(65535).charCodeAt(0)", ToInt16(65535), String.fromCharCode(65535).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(65536).charCodeAt(0)", ToInt16(65536), String.fromCharCode(65536).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(65537).charCodeAt(0)", ToInt16(65537), String.fromCharCode(65537).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(131071).charCodeAt(0)", ToInt16(131071), String.fromCharCode(131071).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(131072).charCodeAt(0)", ToInt16(131072), String.fromCharCode(131072).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(131073).charCodeAt(0)", ToInt16(131073), String.fromCharCode(131073).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode('65535').charCodeAt(0)", 65535, String.fromCharCode("65535").charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode('65536').charCodeAt(0)", 0, String.fromCharCode("65536").charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(-1).charCodeAt(0)", ToInt16(-1), String.fromCharCode(-1).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-64).charCodeAt(0)", ToInt16(-64), String.fromCharCode(-64).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-126).charCodeAt(0)", ToInt16(-126), String.fromCharCode(-126).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-127).charCodeAt(0)", ToInt16(-127), String.fromCharCode(-127).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-128).charCodeAt(0)", ToInt16(-128), String.fromCharCode(-128).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-130).charCodeAt(0)", ToInt16(-130), String.fromCharCode(-130).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-255).charCodeAt(0)", ToInt16(-255), String.fromCharCode(-255).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-256).charCodeAt(0)", ToInt16(-256), String.fromCharCode(-256).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(-Math.pow(2,16)).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(-65535).charCodeAt(0)", ToInt16(-65535), String.fromCharCode(-65535).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-65536).charCodeAt(0)", ToInt16(-65536), String.fromCharCode(-65536).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-65537).charCodeAt(0)", ToInt16(-65537), String.fromCharCode(-65537).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode(-131071).charCodeAt(0)", ToInt16(-131071), String.fromCharCode(-131071).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-131072).charCodeAt(0)", ToInt16(-131072), String.fromCharCode(-131072).charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode(-131073).charCodeAt(0)", ToInt16(-131073), String.fromCharCode(-131073).charCodeAt(0) );
+
+new TestCase( "9.7", "String.fromCharCode('-65535').charCodeAt(0)", ToInt16(-65535), String.fromCharCode("-65535").charCodeAt(0) );
+new TestCase( "9.7", "String.fromCharCode('-65536').charCodeAt(0)", ToInt16(-65536), String.fromCharCode("-65536").charCodeAt(0) );
+
+
+// new TestCase( "9.7", "String.fromCharCode(2147483648).charCodeAt(0)", ToInt16(2147483648), String.fromCharCode(2147483648).charCodeAt(0) );
+
+
+
+// the following test cases cause a runtime error. see: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=78878
+
+// new TestCase( "9.7", "String.fromCharCode(Infinity).charCodeAt(0)", 0, String.fromCharCode("Infinity").charCodeAt(0) );
+// new TestCase( "9.7", "String.fromCharCode(-Infinity).charCodeAt(0)", 0, String.fromCharCode("-Infinity").charCodeAt(0) );
+// new TestCase( "9.7", "String.fromCharCode(NaN).charCodeAt(0)", 0, String.fromCharCode(Number.NaN).charCodeAt(0) );
+// new TestCase( "9.7", "String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0) );
+// new TestCase( "9.7", "String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0) );
+
+test();
+
+function ToInt16( num ) {
+ num = Number( num );
+ if ( isNaN( num ) || num == 0 || num == Number.POSITIVE_INFINITY || num == Number.NEGATIVE_INFINITY ) {
+ return 0;
+ }
+
+ var sign = ( num < 0 ) ? -1 : 1;
+
+ num = sign * Math.floor( Math.abs( num ) );
+
+ num = num % Math.pow(2,16);
+
+ num = ( num > -65536 && num < 0) ? 65536 + num : num;
+
+ return num;
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js
new file mode 100644
index 0000000000..897dc59f6f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js
@@ -0,0 +1,167 @@
+/* -*- 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 = '9.8.1.js';
+
+/**
+ File Name: 9.8.1.js
+ ECMA Section: 9.8.1 ToString Applied to the Number Type
+ Description: The operator ToString convers a number m to string
+ as follows:
+
+ 1. if m is NaN, return the string "NaN"
+ 2. if m is +0 or -0, return the string "0"
+ 3. if m is less than zero, return the string
+ concatenation of the string "-" and ToString(-m).
+ 4. If m is Infinity, return the string "Infinity".
+ 5. Otherwise, let n, k, and s be integers such that
+ k >= 1, 10k1 <= s < 10k, the number value for s10nk
+ is m, and k is as small as possible. Note that k is
+ the number of digits in the decimal representation
+ of s, that s is not divisible by 10, and that the
+ least significant digit of s is not necessarily
+ uniquely determined by these criteria.
+ 6. If k <= n <= 21, return the string consisting of the
+ k digits of the decimal representation of s (in order,
+ with no leading zeroes), followed by n-k occurences
+ of the character '0'.
+ 7. If 0 < n <= 21, return the string consisting of the
+ most significant n digits of the decimal
+ representation of s, followed by a decimal point
+ '.', followed by the remaining kn digits of the
+ decimal representation of s.
+ 8. If 6 < n <= 0, return the string consisting of the
+ character '0', followed by a decimal point '.',
+ followed by n occurences of the character '0',
+ followed by the k digits of the decimal
+ representation of s.
+ 9. Otherwise, if k = 1, return the string consisting
+ of the single digit of s, followed by lowercase
+ character 'e', followed by a plus sign '+' or minus
+ sign '' according to whether n1 is positive or
+ negative, followed by the decimal representation
+ of the integer abs(n1) (with no leading zeros).
+ 10. Return the string consisting of the most significant
+ digit of the decimal representation of s, followed
+ by a decimal point '.', followed by the remaining k1
+ digits of the decimal representation of s, followed
+ by the lowercase character 'e', followed by a plus
+ sign '+' or minus sign '' according to whether n1 is
+ positive or negative, followed by the decimal
+ representation of the integer abs(n1) (with no
+ leading zeros).
+
+ Note that if x is any number value other than 0, then
+ ToNumber(ToString(x)) is exactly the same number value as x.
+
+ As noted, the least significant digit of s is not always
+ uniquely determined by the requirements listed in step 5.
+ The following specification for step 5 was considered, but
+ not adopted:
+
+ Author: christine@netscape.com
+ Date: 10 july 1997
+*/
+
+var SECTION = "9.8.1";
+var VERSION = "ECMA_1";
+startTest();
+
+writeHeaderToLog( SECTION + " ToString applied to the Number type");
+
+new TestCase( SECTION, "Number.NaN", "NaN", Number.NaN + "" );
+new TestCase( SECTION, "0", "0", 0 + "" );
+new TestCase( SECTION, "-0", "0", -0 + "" );
+new TestCase( SECTION, "Number.POSITIVE_INFINITY", "Infinity", Number.POSITIVE_INFINITY + "" );
+new TestCase( SECTION, "Number.NEGATIVE_INFINITY", "-Infinity", Number.NEGATIVE_INFINITY + "" );
+new TestCase( SECTION, "-1", "-1", -1 + "" );
+
+// cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21
+
+new TestCase( SECTION, "1", "1", 1 + "" );
+new TestCase( SECTION, "10", "10", 10 + "" );
+new TestCase( SECTION, "100", "100", 100 + "" );
+new TestCase( SECTION, "1000", "1000", 1000 + "" );
+new TestCase( SECTION, "10000", "10000", 10000 + "" );
+new TestCase( SECTION, "10000000000", "10000000000", 10000000000 + "" );
+new TestCase( SECTION, "10000000000000000000", "10000000000000000000", 10000000000000000000 + "" );
+new TestCase( SECTION, "100000000000000000000","100000000000000000000",100000000000000000000 + "" );
+
+new TestCase( SECTION, "12345", "12345", 12345 + "" );
+new TestCase( SECTION, "1234567890", "1234567890", 1234567890 + "" );
+
+new TestCase( SECTION, "-1", "-1", -1 + "" );
+new TestCase( SECTION, "-10", "-10", -10 + "" );
+new TestCase( SECTION, "-100", "-100", -100 + "" );
+new TestCase( SECTION, "-1000", "-1000", -1000 + "" );
+new TestCase( SECTION, "-1000000000", "-1000000000", -1000000000 + "" );
+new TestCase( SECTION, "-1000000000000000", "-1000000000000000", -1000000000000000 + "" );
+new TestCase( SECTION, "-100000000000000000000", "-100000000000000000000", -100000000000000000000 + "" );
+new TestCase( SECTION, "-1000000000000000000000", "-1e+21", -1000000000000000000000 + "" );
+
+new TestCase( SECTION, "-12345", "-12345", -12345 + "" );
+new TestCase( SECTION, "-1234567890", "-1234567890", -1234567890 + "" );
+
+// cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21,
+new TestCase( SECTION, "1.0000001", "1.0000001", 1.0000001 + "" );
+
+// cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0
+
+// cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6
+
+new TestCase( SECTION, "1000000000000000000000", "1e+21", 1000000000000000000000 + "" );
+new TestCase( SECTION, "10000000000000000000000", "1e+22", 10000000000000000000000 + "" );
+
+// cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6
+
+new TestCase( SECTION, "1.2345", "1.2345", String( 1.2345));
+new TestCase( SECTION, "1.234567890", "1.23456789", String( 1.234567890 ));
+
+
+new TestCase( SECTION, ".12345", "0.12345", String(.12345 ) );
+new TestCase( SECTION, ".012345", "0.012345", String(.012345) );
+new TestCase( SECTION, ".0012345", "0.0012345", String(.0012345) );
+new TestCase( SECTION, ".00012345", "0.00012345", String(.00012345) );
+new TestCase( SECTION, ".000012345", "0.000012345", String(.000012345) );
+new TestCase( SECTION, ".0000012345", "0.0000012345", String(.0000012345) );
+new TestCase( SECTION, ".00000012345", "1.2345e-7", String(.00000012345));
+
+new TestCase( SECTION, "-1e21", "-1e+21", String(-1e21) );
+
+test();
+
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js
new file mode 100644
index 0000000000..ea22980767
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js
@@ -0,0 +1,119 @@
+/* -*- 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 = '9.9-1.js';
+
+/**
+ File Name: 9.9-1.js
+ ECMA Section: 9.9 Type Conversion: ToObject
+ Description:
+
+ undefined generate a runtime error
+ null generate a runtime error
+ boolean create a new Boolean object whose default
+ value is the value of the boolean.
+ number Create a new Number object whose default
+ value is the value of the number.
+ string Create a new String object whose default
+ value is the value of the string.
+ object Return the input argument (no conversion).
+ Author: christine@netscape.com
+ Date: 17 july 1997
+*/
+
+var VERSION = "ECMA_1";
+startTest();
+var SECTION = "9.9-1";
+
+writeHeaderToLog( SECTION + " Type Conversion: ToObject" );
+
+new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() );
+new TestCase( SECTION, "typeof Object(true)", "object", typeof Object(true) );
+
+new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() );
+new TestCase( SECTION, "typeof Object(false)", "object", typeof Object(false) );
+
+new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() );
+new TestCase( SECTION, "typeof Object(0)", "object", typeof Object(0) );
+
+new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() );
+new TestCase( SECTION, "typeof Object(-0)", "object", typeof Object(-0) );
+
+new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() );
+new TestCase( SECTION, "typeof Object(1)", "object", typeof Object(1) );
+
+new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() );
+new TestCase( SECTION, "typeof Object(-1)", "object", typeof Object(-1) );
+
+new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() );
+new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "object", typeof Object(Number.MAX_VALUE) );
+
+new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() );
+new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "object", typeof Object(Number.MIN_VALUE) );
+
+new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() );
+new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "object", typeof Object(Number.POSITIVE_INFINITY) );
+
+new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() );
+new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "object", typeof Object(Number.NEGATIVE_INFINITY) );
+
+new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() );
+new TestCase( SECTION, "typeof Object(Number.NaN)", "object", typeof Object(Number.NaN) );
+
+new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() );
+new TestCase( SECTION, "typeof Object('a string')", "object", typeof (Object("a string")) );
+
+new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() );
+new TestCase( SECTION, "typeof Object('')", "object", typeof (Object("")) );
+
+new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() );
+new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "object", typeof (Object("\\r\\t\\b\\n\\v\\f")) );
+
+new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() );
+new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "object", typeof Object("\'\"\\") );
+
+new TestCase( SECTION, "Object( new MyObject(true) ).valueOf()", true, eval("Object( new MyObject(true) ).valueOf()") );
+new TestCase( SECTION, "typeof Object( new MyObject(true) )", "object", eval("typeof Object( new MyObject(true) )") );
+new TestCase( SECTION, "(Object( new MyObject(true) )).toString()", "[object Object]", eval("(Object( new MyObject(true) )).toString()") );
+
+test();
+
+function MyObject( value ) {
+ this.value = value;
+ this.valueOf = new Function ( "return this.value" );
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js
new file mode 100644
index 0000000000..49ce60f627
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'TypeConversion';