Author: [EMAIL PROTECTED]
Date: Sun Nov 16 23:03:12 2008
New Revision: 766
Modified:
branches/0.3/src/api.cc
branches/0.3/src/scanner.cc
branches/0.3/test/mozilla/mozilla.status
Log:
Merge revision 765 to 0.3 branch. Ignore byte-order marks when scanning.
New version: 0.3.9.1.
Modified: branches/0.3/src/api.cc
==============================================================================
--- branches/0.3/src/api.cc (original)
+++ branches/0.3/src/api.cc Sun Nov 16 23:03:12 2008
@@ -2223,7 +2223,7 @@
const char* v8::V8::GetVersion() {
- return "0.3.9";
+ return "0.3.9.1";
}
Modified: branches/0.3/src/scanner.cc
==============================================================================
--- branches/0.3/src/scanner.cc (original)
+++ branches/0.3/src/scanner.cc Sun Nov 16 23:03:12 2008
@@ -234,11 +234,25 @@
}
+static inline bool IsByteOrderMark(uc32 c) {
+ // The Unicode value U+FFFE is guaranteed never to be assigned as a
+ // Unicode character; this implies that in a Unicode context the
+ // 0xFF, 0xFE byte pattern can only be interpreted as the U+FEFF
+ // character expressed in little-endian byte order (since it could
+ // not be a U+FFFE character expressed in big-endian byte
+ // order). Nevertheless, we check for it to be compatible with
+ // Spidermonkey.
+ return c == 0xFEFF || c == 0xFFFE;
+}
+
+
void Scanner::SkipWhiteSpace(bool initial) {
has_line_terminator_before_next_ = initial;
while (true) {
- while (kIsWhiteSpace.get(c0_)) {
+ // We treat byte-order marks (BOMs) as whitespace for better
+ // compatibility with Spidermonkey and other JavaScript engines.
+ while (kIsWhiteSpace.get(c0_) || IsByteOrderMark(c0_)) {
// IsWhiteSpace() includes line terminators!
if (kIsLineTerminator.get(c0_))
// Ignore line terminators, but remember them. This is necessary
Modified: branches/0.3/test/mozilla/mozilla.status
==============================================================================
--- branches/0.3/test/mozilla/mozilla.status (original)
+++ branches/0.3/test/mozilla/mozilla.status Sun Nov 16 23:03:12 2008
@@ -570,10 +570,7 @@
js1_5/Regress/regress-303213: FAIL
-# Bug 1193440: Ignore Unicode BOM characters when scanning.
-ecma_3/extensions/regress-368516: FAIL
-
-# Bug 1202592:New ecma_3/String/15.5.4.11 is failing.
+# Bug 1202592: New ecma_3/String/15.5.4.11 is failing.
ecma_3/String/15.5.4.11: FAIL
# Bug 1202597: New js1_5/Expressions/regress-394673 is failing.
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---