summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
commitdd91e772430dc294e3bf478c119ef8d43c0a3358 (patch)
tree6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/JavaScriptCore/tests
parentad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff)
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/JavaScriptCore/tests')
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js4
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js9
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma/TypeConversion/9.3.1-3.js6
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/constructor-001.js2
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/function-001.js2
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/hex-001.js3
-rw-r--r--Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js8
-rw-r--r--Source/JavaScriptCore/tests/mozilla/js1_2/regexp/hexadecimal.js2
-rw-r--r--Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js6
9 files changed, 23 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js b/Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js
index e57408b03..71a45e66e 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js
@@ -104,6 +104,8 @@ function getTestCases() {
for ( var i = 0X0020, TEST_STRING = "var A = new Array( " ; i < 0x00ff; i++ ) {
+ if ( i === 0x58 || i === 0x78 ) // x or X - skip testing invalid hex escapes.
+ continue;
TEST_STRING += "\'\\"+ String.fromCharCode( i ) +"\'";
if ( i < 0x00FF - 1 ) {
TEST_STRING += ",";
@@ -112,7 +114,7 @@ function getTestCases() {
}
}
- var LENGTH = 0x00ff - 0x0020;
+ var LENGTH = 0x00ff - 0x0020 - 2; // x & X
array[item++] = new TestCase( SECTION,
TEST_STRING +" A[150] = 'hello'; A[150]",
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js b/Source/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js
index 769b81989..d8e26afd5 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js
@@ -170,9 +170,9 @@ function getTestCases() {
array[item++] = new TestCase( SECTION, "\\x0F0", String.fromCharCode(15)+"0", "\x0F0" );
// G is out of hex range
-
- array[item++] = new TestCase( SECTION, "\\xG", "xG", "\xG" );
- array[item++] = new TestCase( SECTION, "\\xCG", "xCG", "\xCG" );
+// Invalid hex escapes are syntax error; these are covered in the sputnik test suite.
+// array[item++] = new TestCase( SECTION, "\\xG", "xG", "\xG" );
+// array[item++] = new TestCase( SECTION, "\\xCG", "xCG", "\xCG" );
// DoubleStringCharacter::EscapeSequence::CharacterEscapeSequence::\ NonEscapeCharacter
array[item++] = new TestCase( SECTION, "\\a", "a", "\a" );
@@ -193,7 +193,8 @@ function getTestCases() {
array[item++] = new TestCase( SECTION, "\\u", "u", "\u" );
array[item++] = new TestCase( SECTION, "\\w", "w", "\w" );
- array[item++] = new TestCase( SECTION, "\\x", "x", "\x" );
+// Invalid hex escapes are syntax error; these are covered in the sputnik test suite.
+// array[item++] = new TestCase( SECTION, "\\x", "x", "\x" );
array[item++] = new TestCase( SECTION, "\\y", "y", "\y" );
array[item++] = new TestCase( SECTION, "\\z", "z", "\z" );
array[item++] = new TestCase( SECTION, "\\9", "9", "\9" );
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma/TypeConversion/9.3.1-3.js b/Source/JavaScriptCore/tests/mozilla/ecma/TypeConversion/9.3.1-3.js
index 69407fb5f..083226e5d 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma/TypeConversion/9.3.1-3.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma/TypeConversion/9.3.1-3.js
@@ -82,7 +82,7 @@ testcases[tc++] = new TestCase( SECTION,
testcases[tc++] = new TestCase( SECTION,
'- "-0x123456789abcde8"',
- 81985529216486880,
+ NaN,
- "-0x123456789abcde8" );
// Convert some large numbers to string
@@ -474,7 +474,7 @@ testcases[tc++] = new TestCase( SECTION,
testcases[tc++] = new TestCase( SECTION,
"parseInt(\"0022\")",
- 18,
+ 22,
parseInt("0022") );
testcases[tc++] = new TestCase( SECTION,
@@ -664,7 +664,7 @@ testcases[tc++] = new TestCase( SECTION,
testcases[tc++] = new TestCase( SECTION,
"- \"-0x123456789abcde8\"",
- 81985529216486880,
+ NaN,
- "-0x123456789abcde8" );
// the following two tests are not strictly ECMA 1.0
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/constructor-001.js b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/constructor-001.js
index be904e576..ceaa39d3d 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/constructor-001.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/constructor-001.js
@@ -40,7 +40,7 @@
AddTestCase(
"(new RegExp()).source",
- "",
+ "(?:)",
re.source );
AddTestCase(
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/function-001.js b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/function-001.js
index 67c4f21d4..96c3ccfdc 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/function-001.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/function-001.js
@@ -40,7 +40,7 @@
AddTestCase(
"(new RegExp()).source",
- "",
+ "(?:)",
re.source );
AddTestCase(
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/hex-001.js b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/hex-001.js
index 122d59cd3..4a04e944d 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/hex-001.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/hex-001.js
@@ -16,7 +16,8 @@
AddRegExpCases( new RegExp("\x41"), "new RegExp('\\x41')", "A", "A", 1, 0, ["A"] );
AddRegExpCases( new RegExp("\x412"),"new RegExp('\\x412')", "A2", "A2", 1, 0, ["A2"] );
- AddRegExpCases( new RegExp("\x1g"), "new RegExp('\\x1g')", "x1g","x1g", 1, 0, ["x1g"] );
+// Invalid hex escapes are syntax error; these are covered in the sputnik test suite.
+// AddRegExpCases( new RegExp("\x1g"), "new RegExp('\\x1g')", "x1g","x1g", 1, 0, ["x1g"] );
AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x41", "\\x41", 1, 0, ["A"] );
AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x412", "\\x412", 1, 0, ["A"] );
diff --git a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js
index 3eb51cbcd..122b94171 100644
--- a/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js
+++ b/Source/JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js
@@ -52,10 +52,6 @@ function AddRegExpCases( re, s, g, i, m, l ) {
// properties
- AddTestCase( re + ".source",
- s,
- re.source );
-
/*
* http://bugzilla.mozilla.org/show_bug.cgi?id=225550 changed
* the behavior of toString() and toSource() on empty regexps.
@@ -63,6 +59,10 @@ function AddRegExpCases( re, s, g, i, m, l ) {
*/
var S = s? s : '(?:)';
+ AddTestCase( re + ".source",
+ S,
+ re.source );
+
AddTestCase( re + ".toString()",
"/" + S +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
re.toString() );
diff --git a/Source/JavaScriptCore/tests/mozilla/js1_2/regexp/hexadecimal.js b/Source/JavaScriptCore/tests/mozilla/js1_2/regexp/hexadecimal.js
index 8f68c9ab9..14e555869 100644
--- a/Source/JavaScriptCore/tests/mozilla/js1_2/regexp/hexadecimal.js
+++ b/Source/JavaScriptCore/tests/mozilla/js1_2/regexp/hexadecimal.js
@@ -30,7 +30,7 @@
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
var VERSION = 'no version';
startTest();
- var TITLE = 'RegExp: \x# (hex) ';
+ var TITLE = 'RegExp: \\x# (hex) ';
writeHeaderToLog('Executing script: hexadecimal.js');
writeHeaderToLog( SECTION + " "+ TITLE);
diff --git a/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js b/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
index 5cab4a75d..fb751e555 100644
--- a/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
+++ b/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
@@ -100,7 +100,7 @@ reportCompare('abc', value, summary + ': push');
// pop
value = 'abc';
-expect = 'c';
+expect = 'TypeError: Unable to delete property.';
try
{
actual = Array.prototype.pop.call(value);
@@ -128,7 +128,7 @@ reportCompare('def', value, summary + ': unshift');
// shift
value = 'abc';
-expect = 'a';
+expect = 'TypeError: Unable to delete property.';
try
{
actual = Array.prototype.shift.call(value);
@@ -142,7 +142,7 @@ reportCompare('abc', value, summary + ': shift');
// splice
value = 'abc';
-expect = 'b';
+expect = 'TypeError: Unable to delete property.';
try
{
actual = Array.prototype.splice.call(value, 1, 1) + '';