Fix the test suite
authorLars Knoll <lars.knoll@digia.com>
Tue, 11 Dec 2012 05:59:37 +0000 (06:59 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 11 Dec 2012 13:50:32 +0000 (14:50 +0100)
We now fail when parsing octal numbers or escape sequences. This
is ok according to the EcmaScript 5.1 spec. So remove all usages
of these numbers or sequences.

In addition delete an invalid test case that can't possibly be
parsed correctly. V8 also chokes on it.

Change-Id: I889de2810310f38206343d16175f9e31ddb44d30
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>

19 files changed:
tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js [deleted file]
tests/auto/qml/qmlmin/tst_qmlmin.cpp
tests/auto/qml/qqmllanguage/data/literals.qml
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp

index a4bf1c7..87cba8c 100644 (file)
@@ -252,44 +252,6 @@ for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_ST
   HEX_VALUE -= Math.pow(16,POWER)*15;
 }
 
-//  let us do some octal tests.  numbers that start with 0 and do not provid a radix should
-//  default to using "0" as a radix.
-
-var OCT_STRING = "0";
-var OCT_VALUE = 0;
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+")",    OCT_VALUE,  parseInt(OCT_STRING) );
-  OCT_VALUE += Math.pow(8,POWER)*7;
-}
-
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+")",    OCT_VALUE,  parseInt(OCT_STRING) );
-  OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// should get the same results as above if we provid the radix of 8 (or 010)
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+",8)",    OCT_VALUE,  parseInt(OCT_STRING,8) );
-  OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+",010)",    OCT_VALUE,  parseInt(OCT_STRING,010) );
-  OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// we shall stop parsing digits when we get one that isn't a numeric literal of the type we think
-// it should be.
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+"8,8)",    OCT_VALUE,  parseInt(OCT_STRING+"8",8) );
-  OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
-  new TestCase( SECTION, "parseInt("+OCT_STRING+"8,010)",    OCT_VALUE,  parseInt(OCT_STRING+"8",010) );
-  OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
 new TestCase( SECTION,
              "parseInt( '0x' )",             
              NaN,       
index 56bf83a..a89154e 100644 (file)
@@ -384,43 +384,12 @@ new TestCase( SECTION,  "parseFloat(0XE)",        14,         parseFloat(0XE));
 new TestCase( SECTION,  "parseFloat(0XF)",        15,         parseFloat(0XF));
 
 
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION,  "parseFloat('00')",        0,         parseFloat("00"));
-new TestCase( SECTION,  "parseFloat('01')",        1,         parseFloat("01"));
-new TestCase( SECTION,  "parseFloat('02')",        2,         parseFloat("02"));
-new TestCase( SECTION,  "parseFloat('03')",        3,         parseFloat("03"));
-new TestCase( SECTION,  "parseFloat('04')",        4,         parseFloat("04"));
-new TestCase( SECTION,  "parseFloat('05')",        5,         parseFloat("05"));
-new TestCase( SECTION,  "parseFloat('06')",        6,         parseFloat("06"));
-new TestCase( SECTION,  "parseFloat('07')",        7,         parseFloat("07"));
-new TestCase( SECTION,  "parseFloat('010')",       10,        parseFloat("010"));
-new TestCase( SECTION,  "parseFloat('011')",       11,        parseFloat("011"));
-
 // A StringNumericLIteral may have any number of leading 0 digits
 
 new TestCase( SECTION,  "parseFloat('001')",        1,         parseFloat("001"));
 new TestCase( SECTION,  "parseFloat('0001')",       1,         parseFloat("0001"));
 new TestCase( SECTION,  "parseFloat('  0001  ')",       1,         parseFloat("  0001  "));
 
-// an octal numeric literal should be treated as an octal
-
-new TestCase( SECTION,  "parseFloat(00)",        0,         parseFloat(00));
-new TestCase( SECTION,  "parseFloat(01)",        1,         parseFloat(01));
-new TestCase( SECTION,  "parseFloat(02)",        2,         parseFloat(02));
-new TestCase( SECTION,  "parseFloat(03)",        3,         parseFloat(03));
-new TestCase( SECTION,  "parseFloat(04)",        4,         parseFloat(04));
-new TestCase( SECTION,  "parseFloat(05)",        5,         parseFloat(05));
-new TestCase( SECTION,  "parseFloat(06)",        6,         parseFloat(06));
-new TestCase( SECTION,  "parseFloat(07)",        7,         parseFloat(07));
-new TestCase( SECTION,  "parseFloat(010)",       8,        parseFloat(010));
-new TestCase( SECTION,  "parseFloat(011)",       9,        parseFloat(011));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION,  "parseFloat(001)",        1,         parseFloat(001));
-new TestCase( SECTION,  "parseFloat(0001)",       1,         parseFloat(0001));
-
 // make sure it's reflexive
 new TestCase( SECTION,  "parseFloat(Math.PI)",      Math.PI,        parseFloat(Math.PI));
 new TestCase( SECTION,  "parseFloat(Math.LN2)",     Math.LN2,       parseFloat(Math.LN2));
index 557b93f..1167b73 100644 (file)
@@ -256,28 +256,6 @@ new TestCase( SECTION,  "parseFloat('          0XD')",        0,         parseFl
 new TestCase( SECTION,  "parseFloat('          0XE')",        0,         parseFloat("          0XE"));
 new TestCase( SECTION,  "parseFloat('          0XF')",        0,         parseFloat("          0XF"));
 
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION,  "parseFloat('          00')",        0,         parseFloat("          00"));
-new TestCase( SECTION,  "parseFloat('          01')",        1,         parseFloat("          01"));
-new TestCase( SECTION,  "parseFloat('          02')",        2,         parseFloat("          02"));
-new TestCase( SECTION,  "parseFloat('          03')",        3,         parseFloat("          03"));
-new TestCase( SECTION,  "parseFloat('          04')",        4,         parseFloat("          04"));
-new TestCase( SECTION,  "parseFloat('          05')",        5,         parseFloat("          05"));
-new TestCase( SECTION,  "parseFloat('          06')",        6,         parseFloat("          06"));
-new TestCase( SECTION,  "parseFloat('          07')",        7,         parseFloat("          07"));
-new TestCase( SECTION,  "parseFloat('          010')",       10,        parseFloat("          010"));
-new TestCase( SECTION,  "parseFloat('          011')",       11,        parseFloat("          011"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION,  "parseFloat('          001')",        1,         parseFloat("          001"));
-new TestCase( SECTION,  "parseFloat('          0001')",       1,         parseFloat("          0001"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION,  "parseFloat(001)",        1,         parseFloat(001));
-new TestCase( SECTION,  "parseFloat(0001)",       1,         parseFloat(0001));
 
 // make sure it'          s reflexive
 new TestCase( SECTION,  "parseFloat( '                    '          +Math.PI+'          ')",      Math.PI,        parseFloat( '                    '          +Math.PI+'          '));
index faeeb9e..18f1986 100644 (file)
@@ -106,9 +106,6 @@ new TestCase( SECTION, "isNaN( '0xaa' )",    false,              isNaN( "0xaa" )
 new TestCase( SECTION, "isNaN( '0x0A' )",    false,              isNaN( "0x0A" ) );
 new TestCase( SECTION, "isNaN( '0xAA' )",    false,              isNaN( "0xAA" ) );
 
-new TestCase( SECTION, "isNaN( 077 )",      false,              isNaN( 077 ) );
-new TestCase( SECTION, "isNaN( '077' )",    false,              isNaN( "077" ) );
-
 
 new TestCase( SECTION, "isNaN( Number.NaN )",   true,              isNaN(Number.NaN) );
 new TestCase( SECTION, "isNaN( Number.POSITIVE_INFINITY )", false,  isNaN(Number.POSITIVE_INFINITY) );
index e3db5e7..9eb52a8 100644 (file)
@@ -107,9 +107,6 @@ new TestCase( SECTION, "isFinite( '0xaa' )",    true,               isFinite( "0
 new TestCase( SECTION, "isFinite( '0x0A' )",    true,               isFinite( "0x0A" ) );
 new TestCase( SECTION, "isFinite( '0xAA' )",    true,               isFinite( "0xAA" ) );
 
-new TestCase( SECTION, "isFinite( 077 )",       true,               isFinite( 077 ) );
-new TestCase( SECTION, "isFinite( '077' )",     true,               isFinite( "077" ) );
-
 new TestCase( SECTION, "isFinite( new String('Infinity') )",        false,      isFinite(new String("Infinity")) );
 new TestCase( SECTION, "isFinite( new String('-Infinity') )",       false,      isFinite(new String("-Infinity")) );
 
index fb13b24..3eacb29 100644 (file)
@@ -85,16 +85,6 @@ new TestCase( SECTION,
              0x100000000 );
 
 new TestCase( SECTION,
-             "077777777777777777",
-             2251799813685247,
-             077777777777777777 );
-
-new TestCase( SECTION,
-             "077777777777777776",
-             2251799813685246,
-             077777777777777776 );
-
-new TestCase( SECTION,
              "0x1fffffffffffff",
              9007199254740991,
              0x1fffffffffffff );
index 8fbe16c..6121cd5 100644 (file)
@@ -74,20 +74,4 @@ new TestCase( SECTION,
              9,
              9 );
 
-new TestCase( SECTION,
-             "09",
-             9,
-             09 );
-
-new TestCase( SECTION,
-             "099",
-             99,
-             099 );
-
-
-new TestCase( SECTION,
-             "077",
-             63,
-             077 );
-
 test();
index 9ccb912..2963559 100644 (file)
@@ -215,24 +215,6 @@ new TestCase( SECTION, "0XE",  14,  0XE );
 new TestCase( SECTION, "0XF",  15,  0XF );
 
 
-new TestCase( SECTION, "00",  0,   00 );
-new TestCase( SECTION, "01",  1,   01 );
-new TestCase( SECTION, "02",  2,   02 );
-new TestCase( SECTION, "03",  3,   03 );
-new TestCase( SECTION, "04",  4,   04 );
-new TestCase( SECTION, "05",  5,   05 );
-new TestCase( SECTION, "06",  6,   06 );
-new TestCase( SECTION, "07",  7,   07 );
-
-new TestCase( SECTION, "000",  0,   000 );
-new TestCase( SECTION, "011",  9,   011 );
-new TestCase( SECTION, "022",  18,  022 );
-new TestCase( SECTION, "033",  27,  033 );
-new TestCase( SECTION, "044",  36,  044 );
-new TestCase( SECTION, "055",  45,  055 );
-new TestCase( SECTION, "066",  54,  066 );
-new TestCase( SECTION, "077",  63,   077 );
-
 new TestCase( SECTION, "0.00000000001",  0.00000000001,  0.00000000001 );
 new TestCase( SECTION, "0.00000000001e-2",  0.0000000000001,  0.00000000001e-2 );
 
index 015a385..92a0494 100644 (file)
@@ -76,53 +76,6 @@ new TestCase( SECTION, "\\v",        String.fromCharCode(0x000B),        "\v" );
 
 // DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::OctalEscapeSequence
 
-new TestCase( SECTION, "\\00",      String.fromCharCode(0x0000),    "\00" );
-new TestCase( SECTION, "\\01",      String.fromCharCode(0x0001),    "\01" );
-new TestCase( SECTION, "\\02",      String.fromCharCode(0x0002),    "\02" );
-new TestCase( SECTION, "\\03",      String.fromCharCode(0x0003),    "\03" );
-new TestCase( SECTION, "\\04",      String.fromCharCode(0x0004),    "\04" );
-new TestCase( SECTION, "\\05",      String.fromCharCode(0x0005),    "\05" );
-new TestCase( SECTION, "\\06",      String.fromCharCode(0x0006),    "\06" );
-new TestCase( SECTION, "\\07",      String.fromCharCode(0x0007),    "\07" );
-
-new TestCase( SECTION, "\\010",      String.fromCharCode(0x0008),    "\010" );
-new TestCase( SECTION, "\\011",      String.fromCharCode(0x0009),    "\011" );
-new TestCase( SECTION, "\\012",      String.fromCharCode(0x000A),    "\012" );
-new TestCase( SECTION, "\\013",      String.fromCharCode(0x000B),    "\013" );
-new TestCase( SECTION, "\\014",      String.fromCharCode(0x000C),    "\014" );
-new TestCase( SECTION, "\\015",      String.fromCharCode(0x000D),    "\015" );
-new TestCase( SECTION, "\\016",      String.fromCharCode(0x000E),    "\016" );
-new TestCase( SECTION, "\\017",      String.fromCharCode(0x000F),    "\017" );
-new TestCase( SECTION, "\\020",      String.fromCharCode(0x0010),    "\020" );
-new TestCase( SECTION, "\\042",      String.fromCharCode(0x0022),    "\042" );
-
-new TestCase( SECTION, "\\0",      String.fromCharCode(0x0000),    "\0" );
-new TestCase( SECTION, "\\1",      String.fromCharCode(0x0001),    "\1" );
-new TestCase( SECTION, "\\2",      String.fromCharCode(0x0002),    "\2" );
-new TestCase( SECTION, "\\3",      String.fromCharCode(0x0003),    "\3" );
-new TestCase( SECTION, "\\4",      String.fromCharCode(0x0004),    "\4" );
-new TestCase( SECTION, "\\5",      String.fromCharCode(0x0005),    "\5" );
-new TestCase( SECTION, "\\6",      String.fromCharCode(0x0006),    "\6" );
-new TestCase( SECTION, "\\7",      String.fromCharCode(0x0007),    "\7" );
-
-new TestCase( SECTION, "\\10",      String.fromCharCode(0x0008),    "\10" );
-new TestCase( SECTION, "\\11",      String.fromCharCode(0x0009),    "\11" );
-new TestCase( SECTION, "\\12",      String.fromCharCode(0x000A),    "\12" );
-new TestCase( SECTION, "\\13",      String.fromCharCode(0x000B),    "\13" );
-new TestCase( SECTION, "\\14",      String.fromCharCode(0x000C),    "\14" );
-new TestCase( SECTION, "\\15",      String.fromCharCode(0x000D),    "\15" );
-new TestCase( SECTION, "\\16",      String.fromCharCode(0x000E),    "\16" );
-new TestCase( SECTION, "\\17",      String.fromCharCode(0x000F),    "\17" );
-new TestCase( SECTION, "\\20",      String.fromCharCode(0x0010),    "\20" );
-new TestCase( SECTION, "\\42",      String.fromCharCode(0x0022),    "\42" );
-
-new TestCase( SECTION, "\\000",      String.fromCharCode(0),        "\000" );
-new TestCase( SECTION, "\\111",      String.fromCharCode(73),       "\111" );
-new TestCase( SECTION, "\\222",      String.fromCharCode(146),      "\222" );
-new TestCase( SECTION, "\\333",      String.fromCharCode(219),      "\333" );
-
-//  following line commented out as it causes a compile time error
-//    new TestCase( SECTION, "\\444",      "444",                         "\444" );
 
 // DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence
 /*
@@ -208,7 +161,6 @@ new TestCase( SECTION, "\\w",    "w",        "\w" );
 new TestCase( SECTION, "\\x",    "x",        "\x" );
 new TestCase( SECTION, "\\y",    "y",        "\y" );
 new TestCase( SECTION, "\\z",    "z",        "\z" );
-new TestCase( SECTION, "\\9",    "9",        "\9" );
 
 new TestCase( SECTION, "\\A",    "A",        "\A" );
 new TestCase( SECTION, "\\B",    "B",        "\B" );
index 0412742..abe1095 100644 (file)
@@ -194,11 +194,6 @@ new TestCase( SECTION,
              Math.abs( -0xfff ) );
 
 new TestCase( SECTION,
-             "Math.abs( -0777 )", 
-             511,   
-             Math.abs(-0777 ) );
-
-new TestCase( SECTION,
              "Math.abs('-1e-1')",  
              0.1,  
              Math.abs('-1e-1') );
index dc56427..3141906 100644 (file)
@@ -296,16 +296,6 @@ new TestCase( SECTION,
              0x100000000 );
 
 new TestCase( SECTION,
-             "077777777777777777",
-             2251799813685247,
-             077777777777777777 );
-
-new TestCase( SECTION,
-             "077777777777777776",
-             2251799813685246,
-             077777777777777776 );
-
-new TestCase( SECTION,
              "0x1fffffffffffff",
              9007199254740991,
              0x1fffffffffffff );
index 401ad43..053720d 100644 (file)
@@ -125,70 +125,6 @@ expectedmatch = Array(string);
 addThis();
 
 
-/*
- * This one should produce a match. The two-character string
- * 'a' + '\011' is duplicated in the pattern and test string:
- */
-status = inSection(4);
-pattern = /.\011/;
-string = 'a\011';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now, for the second character of the string,
- * use the Unicode escape '\u0009' instead of the octal escape '\011'
- */
-status = inSection(5);
-pattern = /.\011/;
-string = 'a\u0009';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now  for the second character of the string,
- * use the hex escape '\x09' instead of the octal escape '\011'
- */
-status = inSection(6);
-pattern = /.\011/;
-string = 'a\x09';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now  for the second character of the string,
- * use the escape '\t' instead of the octal escape '\011'
- */
-status = inSection(7);
-pattern = /.\011/;
-string = 'a\t';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Return to the string from Section 1.
- *
- * Unlike Section 1, use the RegExp() function to create the
- * regexp pattern: null character followed by the string '11'.
- *
- * Since this is exactly what the string is, we should get a match -
- */
-status = inSection(8);
-string = 'a' + String.fromCharCode(0) + '11';
-pattern = RegExp(string);
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
 
 
 //-------------------------------------------------------------------------------------------------
index bca1a15..7b811ab 100644 (file)
@@ -111,11 +111,11 @@ testRegExp([status], [re], [str], [result], [expect]);
 //# Some things for avoiding backslashitis later on.
 $esc        = '\\\\';     
 $Period      = '\.';
-$space      = '\040';              $tab         = '\t';
+$space      = '\x20';              $tab         = '\t';
 $OpenBR     = '\\[';               $CloseBR     = '\\]';
 $OpenParen  = '\\(';               $CloseParen  = '\\)';
-$NonASCII   = '\x80-\xff';         $ctrl        = '\000-\037';
-$CRlist     = '\n\015';  //# note: this should really be only \015.
+$NonASCII   = '\x80-\xff';         $ctrl        = '\0-\x1f';
+$CRlist     = '\n\x0d';  //# note: this should really be only \015.
 // Items 19, 20, 21
 $qtext = '[^' + $esc + $NonASCII + $CRlist + '\"]';                                              // # for within "..."
 $dtext = '[^' + $esc + $NonASCII + $CRlist + $OpenBR + $CloseBR + ']';    // # for within [...]
@@ -226,7 +226,7 @@ $route_addr =
   '>';                           // #                 >
 
 //# Item 3: phrase........
-$phrase_ctrl = '\000-\010\012-\037'; // # like ctrl, but without tab
+$phrase_ctrl = '\0-\x08\x0a-\x1f'; // # like ctrl, but without tab
 
 //# Like atom-char, but without listing space, and uses phrase_ctrl.
 //# Since the class is negated, this matches the same as atom-char plus space and tab
index 1be1997..27ddfab 100755 (executable)
@@ -37,7 +37,7 @@
 
 var gTestfile = 'regress-441477-01.js';
 //-----------------------------------------------------------------------------
-var BUGNUMBER = 441477-01;
+var BUGNUMBER = 441477.01;
 var summary = '';
 var actual = 'No Exception';
 var expect = 'No Exception';
index 368fde1..59564b2 100755 (executable)
@@ -55,7 +55,7 @@ function test()
  
   expect = ["", undefined, ""] + '';
   actual = "y".split(/(x)?\1y/) + '';
-  reportCompare(expect, actual, summary + ': "y".split(/(x)?\1y/)');
+  reportCompare(expect, actual, summary + ': "y".split(/(x)?\\1y/)');
 
   expect = ["", undefined, ""] + '';
   actual = "y".split(/(x)?y/) + '';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
deleted file mode 100755 (executable)
index 0e3c4b0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is JavaScript Engine testing utilities.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Martin Honnen
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var gTestfile = 'regress-352044-02-n.js';
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 352044;
-var summary = 'issues with Unicode escape sequences in JavaScript source code';
-var actual = 'No Error';
-var expect = 'SyntaxError';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  print('This test case is expected to throw an uncaught SyntaxError');
-
-  try
-  {
-    var i = 1;
-    i \u002b= 1; 
-    print(i);
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
index 60b69f2..be93a79 100644 (file)
@@ -120,6 +120,10 @@ void tst_qmlmin::initTestCase()
     invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingFileQualifier.js";
     invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleQualifier.js";
     invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleVersion.js";
+    invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml";
+    invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml";
+    invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml";
+    invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml";
 }
 
 QStringList tst_qmlmin::findFiles(const QDir &d)
index 3a3e846..9c6003d 100644 (file)
@@ -2,7 +2,7 @@ import QtQuick 2.0
 
 QtObject {
     property variant n1:  0xFe32   // hex
-    property variant n2:  015      // octal
+    property variant n2:  015
     property variant n3:  -4.2E11  // floating-point literals
     property variant n4:  .1e9
     property variant n5:  3e-12
@@ -18,7 +18,6 @@ QtObject {
     property variant c7:  "\'"
     property variant c8:  "\""
     property variant c9:  "\\"
-    property variant c10:  "\251"
-    property variant c11:  "\xA9"
-    property variant c12:  "\u00A9" // unicode
+    property variant c10:  "\xA9"
+    property variant c11:  "\u00A9" // unicode
 }
index cf6c834..70f8f48 100644 (file)
@@ -3066,8 +3066,8 @@ void tst_qqmllanguage::literals_data()
     QTest::newRow("special9") << "c9" << QVariant(QString("\\"));
     // We don't handle octal escape sequences
 //    QTest::newRow("special10") << "c10" << QVariant(QString("\251"));
-    QTest::newRow("special11") << "c11" << QVariant(QString::fromLatin1("\xa9"));
-    QTest::newRow("special12") << "c12" << QVariant(QString::fromUtf8("\u00A9"));
+    QTest::newRow("special11") << "c10" << QVariant(QString::fromLatin1("\xa9"));
+    QTest::newRow("special12") << "c11" << QVariant(QString::fromUtf8("\u00A9"));
 }
 
 void tst_qqmllanguage::literals()