Fix bug in keyed load stub for strings.

Instead of returning the empty string when indexing
a string out of bounds we now correctly return undefined.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3611 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent acf74b04
......@@ -1479,7 +1479,11 @@ static Object* Runtime_StringCharAt(Arguments args) {
CONVERT_CHECKED(String, subject, args[0]);
Object* index = args[1];
return CharFromCode(CharCodeAt(subject, index));
Object* code = CharCodeAt(subject, index);
if (code == Heap::nan_value()) {
return Heap::undefined_value();
}
return CharFromCode(code);
}
......
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