Commit 367e9b5d authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Fix regression in regexp-caching.html

Review URL: http://codereview.chromium.org/27273

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 634c4b94
......@@ -318,7 +318,8 @@ function SetupRegExp() {
return IS_UNDEFINED(regExpInput) ? "" : regExpInput;
}
function RegExpSetInput(string) {
lastMatchInfo[lastMatchInfo[REGEXP_NUMBER_OF_CAPTURES] + 2] = string;
lastMatchInfo[lastMatchInfo[REGEXP_NUMBER_OF_CAPTURES] + 2] =
ToString(string);
};
%DefineAccessor($RegExp, 'input', GETTER, RegExpGetInput, DONT_DELETE);
......
......@@ -132,3 +132,8 @@ for (var i = 4; i < 10; ++i) {
re = /(.)/g;
function f() { return RegExp.$1; };
assertEquals('abcd', 'abcd'.replace(re, f));
RegExp.multiline = "foo";
assertTrue(typeof RegExp.multiline == typeof Boolean(), "RegExp.multiline coerces values to booleans");
RegExp.input = Number();
assertTrue(typeof RegExp.input == typeof String(), "RegExp.input coerces values to booleans");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment