[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:17:10 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit c38d284df1c30e205cbed8fc3b219659419d45a1
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 8 11:17:27 2010 +0000
2010-01-08 Kent Hansen <kent.hansen at nokia.com>
Reviewed by Darin Adler.
RegExp.prototype.toString returns "//" for empty regular expressions
https://bugs.webkit.org/show_bug.cgi?id=33319
"//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
2010-01-08 Kent Hansen <kent.hansen at nokia.com>
Reviewed by Darin Adler.
RegExp.prototype.toString returns "//" for empty regular expressions
https://bugs.webkit.org/show_bug.cgi?id=33319
Add new test cases and adapt existing ones.
* fast/js/kde/RegExp-expected.txt:
* fast/js/kde/script-tests/RegExp.js:
* fast/js/script-tests/regexp-compile.js:
* fast/regex/non-pattern-characters-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 6bb9620..b433dee 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-08 Kent Hansen <kent.hansen at nokia.com>
+
+ Reviewed by Darin Adler.
+
+ RegExp.prototype.toString returns "//" for empty regular expressions
+ https://bugs.webkit.org/show_bug.cgi?id=33319
+
+ "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
+
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncToString):
+
2010-01-08 Norbert Leser <norbert.leser at nokia.com>
Reviewed by Darin Adler.
diff --git a/JavaScriptCore/runtime/RegExpPrototype.cpp b/JavaScriptCore/runtime/RegExpPrototype.cpp
index c3ee565..0609b29 100644
--- a/JavaScriptCore/runtime/RegExpPrototype.cpp
+++ b/JavaScriptCore/runtime/RegExpPrototype.cpp
@@ -114,8 +114,8 @@ JSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec, JSObject*, JSValu
postfix[index++] = 'i';
if (asRegExpObject(thisValue)->get(exec, exec->propertyNames().multiline).toBoolean(exec))
postfix[index] = 'm';
-
- return jsNontrivialString(exec, makeString("/", asRegExpObject(thisValue)->get(exec, exec->propertyNames().source).toString(exec), postfix));
+ UString source = asRegExpObject(thisValue)->get(exec, exec->propertyNames().source).toString(exec);
+ return jsNontrivialString(exec, makeString("/", source.size() ? source : UString("(?:)"), postfix));
}
} // namespace JSC
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8d244c0..c058fdb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-08 Kent Hansen <kent.hansen at nokia.com>
+
+ Reviewed by Darin Adler.
+
+ RegExp.prototype.toString returns "//" for empty regular expressions
+ https://bugs.webkit.org/show_bug.cgi?id=33319
+
+ Add new test cases and adapt existing ones.
+
+ * fast/js/kde/RegExp-expected.txt:
+ * fast/js/kde/script-tests/RegExp.js:
+ * fast/js/script-tests/regexp-compile.js:
+ * fast/regex/non-pattern-characters-expected.txt:
+
2010-01-08 Eric Seidel <eric at webkit.org>
Reviewed by Simon Hausmann.
diff --git a/LayoutTests/fast/js/kde/RegExp-expected.txt b/LayoutTests/fast/js/kde/RegExp-expected.txt
index 52dbba1..6151bbf 100644
--- a/LayoutTests/fast/js/kde/RegExp-expected.txt
+++ b/LayoutTests/fast/js/kde/RegExp-expected.txt
@@ -92,6 +92,10 @@ PASS /\u0061/.source is '\\u0061'
PASS 'abc'.match(/\u0062/).toString() is 'b'
FAIL Object.prototype.toString.apply(RegExp.prototype) should be [object RegExp]. Was [object RegExpPrototype].
PASS typeof RegExp.prototype.toString() is 'string'
+PASS new RegExp().toString() is '/(?:)/'
+PASS (new RegExp('(?:)')).source is '(?:)'
+PASS /(?:)/.toString() is '/(?:)/'
+PASS /(?:)/.source is '(?:)'
Done.
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/js/kde/script-tests/RegExp.js b/LayoutTests/fast/js/kde/script-tests/RegExp.js
index cb7a142..fbab840 100644
--- a/LayoutTests/fast/js/kde/script-tests/RegExp.js
+++ b/LayoutTests/fast/js/kde/script-tests/RegExp.js
@@ -148,5 +148,11 @@ shouldBe("Object.prototype.toString.apply(RegExp.prototype)",
// it doesn't throw an exception
shouldBe("typeof RegExp.prototype.toString()", "'string'");
+// Empty regular expressions have string representation /(?:)/
+shouldBe("new RegExp().toString()", "'/(?:)/'");
+shouldBe("(new RegExp('(?:)')).source", "'(?:)'");
+shouldBe("/(?:)/.toString()", "'/(?:)/'");
+shouldBe("/(?:)/.source", "'(?:)'");
+
debug("Done.");
successfullyParsed = true
diff --git a/LayoutTests/fast/js/regexp-compile-expected.txt b/LayoutTests/fast/js/regexp-compile-expected.txt
index 854d50a..a6bee52 100644
--- a/LayoutTests/fast/js/regexp-compile-expected.txt
+++ b/LayoutTests/fast/js/regexp-compile-expected.txt
@@ -19,7 +19,7 @@ PASS re.toString() is '/c/i'
PASS re.compile(new RegExp('+')); threw exception SyntaxError: Invalid regular expression: nothing to repeat.
PASS re.toString() is '/undefined/'
PASS re.toString() is '/null/'
-PASS re.toString() is '//'
+PASS re.toString() is '/(?:)/'
PASS re.toString() is '/z/'
PASS re.lastIndex is 0
PASS re.lastIndex is 1
diff --git a/LayoutTests/fast/js/script-tests/regexp-compile.js b/LayoutTests/fast/js/script-tests/regexp-compile.js
index eae5787..5a21300 100644
--- a/LayoutTests/fast/js/script-tests/regexp-compile.js
+++ b/LayoutTests/fast/js/script-tests/regexp-compile.js
@@ -38,7 +38,7 @@ re.compile(null);
shouldBe("re.toString()", "'/null/'");
re.compile();
-shouldBe("re.toString()", "'//'"); // /(?:)/ in Firefox
+shouldBe("re.toString()", "'/(?:)/'");
re.compile("z", undefined);
shouldBe("re.toString()", "'/z/'");
diff --git a/LayoutTests/fast/regex/non-pattern-characters-expected.txt b/LayoutTests/fast/regex/non-pattern-characters-expected.txt
index c6c7bcb..de39fed 100644
--- a/LayoutTests/fast/regex/non-pattern-characters-expected.txt
+++ b/LayoutTests/fast/regex/non-pattern-characters-expected.txt
@@ -156,7 +156,7 @@ Testing regexp: /a}/gm
PASS regexp.test('a}') is true
PASS regexp.lastIndex is 2
-Testing regexp: //gm
+Testing regexp: /(?:)/gm
PASS regexp.test('') is true
PASS regexp.lastIndex is 0
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list