diff options
author | Erik Verbruggen <erik.verbruggen@me.com> | 2013-03-18 15:30:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-19 01:57:27 +0100 |
commit | a89a652bf5a9cb01ad2babc4c1374ba0b4d07edd (patch) | |
tree | 894fabdae7898cf02b5bb8b050506b5806585d8e /tests/auto/qml/parserstress | |
parent | 9237c2ecb5c6fc8820c28a636d1112990c950bbe (diff) |
Fix hexadecimal escape sequence validation in strings.
Give an error message when the sequence does not conform to the grammar.
Although the specification does not explicitly state that this is an
error, this is the behaviour of both JSC and V8.
Change-Id: I34d189f07628bc6cc40b13bfbb8d09bee7810ced
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/parserstress')
-rw-r--r-- | tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js | 3 | ||||
-rw-r--r-- | tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js index 4a3173db6c..4b799f8df1 100644 --- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js +++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js @@ -135,9 +135,10 @@ new TestCase( SECTION, "\\x1E1", String.fromCharCode(30)+"1", "\x1E new TestCase( SECTION, "\\x0F0", String.fromCharCode(15)+"0", "\x0F0" ); // G is out of hex range - +/* Invalid testcase: we no longer silently ignore invalid hexadecimal escape sequences. new TestCase( SECTION, "\\xG", "xG", "\xG" ); new TestCase( SECTION, "\\xCG", "xCG", "\xCG" ); +*/ // DoubleStringCharacter::EscapeSequence::CharacterEscapeSequence::\ NonEscapeCharacter new TestCase( SECTION, "\\a", "a", "\a" ); diff --git a/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js index 3e85ac7abf..f2dccd9267 100644 --- a/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js +++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js @@ -55,7 +55,10 @@ startTest(); AddRegExpCases( new RegExp("\x41"), "new RegExp('\\x41')", "A", "A", 1, 0, ["A"] ); AddRegExpCases( new RegExp("\x412"),"new RegExp('\\x412')", "A2", "A2", 1, 0, ["A2"] ); + +/* Invalid testcase: we no longer silently ignore invalid hexadecimal escape sequences. 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"] ); |