Title: [187506] trunk
Revision
187506
Author
[email protected]
Date
2015-07-28 13:20:40 -0700 (Tue, 28 Jul 2015)

Log Message

Misleading error message: "At least one digit must occur after a decimal point"
https://bugs.webkit.org/show_bug.cgi?id=146238

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

Interestingly, we had a comment explaining what this error message was
about that is much clearer than the error message itself. This patch
simply replaces the error message with the explanation from the
comment.

* parser/Lexer.cpp:
(JSC::Lexer<T>::lex):

LayoutTests:

The expected error message in this test has changed.

* js/basic-strict-mode-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (187505 => 187506)


--- trunk/LayoutTests/ChangeLog	2015-07-28 20:12:33 UTC (rev 187505)
+++ trunk/LayoutTests/ChangeLog	2015-07-28 20:20:40 UTC (rev 187506)
@@ -1,3 +1,14 @@
+2015-07-28  Basile Clement  <[email protected]>
+
+        Misleading error message: "At least one digit must occur after a decimal point"
+        https://bugs.webkit.org/show_bug.cgi?id=146238
+
+        Reviewed by Geoffrey Garen.
+
+        The expected error message in this test has changed.
+
+        * js/basic-strict-mode-expected.txt:
+
 2015-07-28  Said Abou-Hallawa  <[email protected]>
 
         Crash happens when calling removeEventListener for an SVG element which has an instance inside a <defs> element of shadow tree

Modified: trunk/LayoutTests/js/basic-strict-mode-expected.txt (187505 => 187506)


--- trunk/LayoutTests/js/basic-strict-mode-expected.txt	2015-07-28 20:12:33 UTC (rev 187505)
+++ trunk/LayoutTests/js/basic-strict-mode-expected.txt	2015-07-28 20:20:40 UTC (rev 187506)
@@ -187,12 +187,12 @@
 PASS 'use strict'; (function f() { for(var i in this); })(); true; is true
 PASS 'use strict'̻ threw exception SyntaxError: Invalid character '\u0827'.
 PASS (function(){'use strict'̻}) threw exception SyntaxError: Invalid character '\u0827'.
-PASS 'use strict'5.f threw exception SyntaxError: At least one digit must occur after a decimal point.
-PASS (function(){'use strict'5.f}) threw exception SyntaxError: At least one digit must occur after a decimal point.
+PASS 'use strict'5.f threw exception SyntaxError: No identifiers allowed directly after numeric literal.
+PASS (function(){'use strict'5.f}) threw exception SyntaxError: No identifiers allowed directly after numeric literal.
 PASS 'use strict';̻ threw exception SyntaxError: Invalid character '\u0827'.
 PASS (function(){'use strict';̻}) threw exception SyntaxError: Invalid character '\u0827'.
-PASS 'use strict';5.f threw exception SyntaxError: At least one digit must occur after a decimal point.
-PASS (function(){'use strict';5.f}) threw exception SyntaxError: At least one digit must occur after a decimal point.
+PASS 'use strict';5.f threw exception SyntaxError: No identifiers allowed directly after numeric literal.
+PASS (function(){'use strict';5.f}) threw exception SyntaxError: No identifiers allowed directly after numeric literal.
 PASS 'use strict';1-(eval=1); threw exception SyntaxError: Cannot modify 'eval' in strict mode..
 PASS (function(){'use strict';1-(eval=1);}) threw exception SyntaxError: Cannot modify 'eval' in strict mode..
 PASS 'use strict';arguments=1; threw exception SyntaxError: Cannot modify 'arguments' in strict mode..

Modified: trunk/Source/_javascript_Core/ChangeLog (187505 => 187506)


--- trunk/Source/_javascript_Core/ChangeLog	2015-07-28 20:12:33 UTC (rev 187505)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-07-28 20:20:40 UTC (rev 187506)
@@ -1,5 +1,20 @@
 2015-07-28  Basile Clement  <[email protected]>
 
+        Misleading error message: "At least one digit must occur after a decimal point"
+        https://bugs.webkit.org/show_bug.cgi?id=146238
+
+        Reviewed by Geoffrey Garen.
+
+        Interestingly, we had a comment explaining what this error message was
+        about that is much clearer than the error message itself. This patch
+        simply replaces the error message with the explanation from the
+        comment.
+
+        * parser/Lexer.cpp:
+        (JSC::Lexer<T>::lex):
+
+2015-07-28  Basile Clement  <[email protected]>
+
         Simplify call linking
         https://bugs.webkit.org/show_bug.cgi?id=147363
 

Modified: trunk/Source/_javascript_Core/parser/Lexer.cpp (187505 => 187506)


--- trunk/Source/_javascript_Core/parser/Lexer.cpp	2015-07-28 20:12:33 UTC (rev 187505)
+++ trunk/Source/_javascript_Core/parser/Lexer.cpp	2015-07-28 20:20:40 UTC (rev 187506)
@@ -2128,9 +2128,8 @@
                 token = tokenTypeForIntegerLikeToken(tokenData->doubleValue);
         }
 
-        // No identifiers allowed directly after numeric literal, e.g. "3in" is bad.
         if (UNLIKELY(isIdentStart(m_current))) {
-            m_lexErrorMessage = ASCIILiteral("At least one digit must occur after a decimal point");
+            m_lexErrorMessage = ASCIILiteral("No identifiers allowed directly after numeric literal");
             token = atEnd() ? UNTERMINATED_NUMERIC_LITERAL_ERRORTOK : INVALID_NUMERIC_LITERAL_ERRORTOK;
             goto returnError;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to