Throw a parse error on octal numbers and escape sequences
authorLars Knoll <lars.knoll@digia.com>
Mon, 10 Dec 2012 21:06:33 +0000 (22:06 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 11 Dec 2012 13:50:32 +0000 (14:50 +0100)
commitbac602c454f38ddde01167a3f75cb10ce1cfb876
tree9e716db6d26ac6daeebc97c7bd29b37123f68a05
parentf96f0083402ef0210192406aaa943b1b5297a584
Throw a parse error on octal numbers and escape sequences

This is compliant with EcmaScript 5.1, where octal numbers
and escape sequences are an optional and deprecated part
of the syntax.

Allow leading 0's in qml mode, but interpret the result
as decimal. This is also to keep compatibility with
existing code.

Change-Id: Ic3450ec3dd17966846751ee688a90c65939ba78f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
13 files changed:
src/qml/qml/parser/qqmljslexer.cpp
tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp