Changeset 52981 in webkit
- Timestamp:
- Jan 8, 2010 3:17:27 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r52978 r52981 1 2010-01-08 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 RegExp.prototype.toString returns "//" for empty regular expressions 6 https://bugs.webkit.org/show_bug.cgi?id=33319 7 8 "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA. 9 10 * runtime/RegExpPrototype.cpp: 11 (JSC::regExpProtoFuncToString): 12 1 13 2010-01-08 Norbert Leser <norbert.leser@nokia.com> 2 14 -
trunk/JavaScriptCore/runtime/RegExpPrototype.cpp
r52028 r52981 115 115 if (asRegExpObject(thisValue)->get(exec, exec->propertyNames().multiline).toBoolean(exec)) 116 116 postfix[index] = 'm'; 117 118 return jsNontrivialString(exec, makeString("/", asRegExpObject(thisValue)->get(exec, exec->propertyNames().source).toString(exec), postfix));117 UString source = asRegExpObject(thisValue)->get(exec, exec->propertyNames().source).toString(exec); 118 return jsNontrivialString(exec, makeString("/", source.size() ? source : UString("(?:)"), postfix)); 119 119 } 120 120 -
trunk/LayoutTests/ChangeLog
r52980 r52981 1 2010-01-08 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 RegExp.prototype.toString returns "//" for empty regular expressions 6 https://bugs.webkit.org/show_bug.cgi?id=33319 7 8 Add new test cases and adapt existing ones. 9 10 * fast/js/kde/RegExp-expected.txt: 11 * fast/js/kde/script-tests/RegExp.js: 12 * fast/js/script-tests/regexp-compile.js: 13 * fast/regex/non-pattern-characters-expected.txt: 14 1 15 2010-01-08 Eric Seidel <eric@webkit.org> 2 16 -
trunk/LayoutTests/fast/js/kde/RegExp-expected.txt
r20149 r52981 93 93 FAIL Object.prototype.toString.apply(RegExp.prototype) should be [object RegExp]. Was [object RegExpPrototype]. 94 94 PASS typeof RegExp.prototype.toString() is 'string' 95 PASS new RegExp().toString() is '/(?:)/' 96 PASS (new RegExp('(?:)')).source is '(?:)' 97 PASS /(?:)/.toString() is '/(?:)/' 98 PASS /(?:)/.source is '(?:)' 95 99 Done. 96 100 PASS successfullyParsed is true -
trunk/LayoutTests/fast/js/kde/script-tests/RegExp.js
r48651 r52981 149 149 shouldBe("typeof RegExp.prototype.toString()", "'string'"); 150 150 151 // Empty regular expressions have string representation /(?:)/ 152 shouldBe("new RegExp().toString()", "'/(?:)/'"); 153 shouldBe("(new RegExp('(?:)')).source", "'(?:)'"); 154 shouldBe("/(?:)/.toString()", "'/(?:)/'"); 155 shouldBe("/(?:)/.source", "'(?:)'"); 156 151 157 debug("Done."); 152 158 successfullyParsed = true -
trunk/LayoutTests/fast/js/regexp-compile-expected.txt
r27571 r52981 20 20 PASS re.toString() is '/undefined/' 21 21 PASS re.toString() is '/null/' 22 PASS re.toString() is '/ /'22 PASS re.toString() is '/(?:)/' 23 23 PASS re.toString() is '/z/' 24 24 PASS re.lastIndex is 0 -
trunk/LayoutTests/fast/js/script-tests/regexp-compile.js
r48651 r52981 39 39 40 40 re.compile(); 41 shouldBe("re.toString()", "'/ /'"); // /(?:)/ in Firefox41 shouldBe("re.toString()", "'/(?:)/'"); 42 42 43 43 re.compile("z", undefined); -
trunk/LayoutTests/fast/regex/non-pattern-characters-expected.txt
r39119 r52981 157 157 PASS regexp.lastIndex is 2 158 158 159 Testing regexp: / /gm159 Testing regexp: /(?:)/gm 160 160 PASS regexp.test('') is true 161 161 PASS regexp.lastIndex is 0
Note: See TracChangeset
for help on using the changeset viewer.