Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 3610) |
+++ src/runtime.cc (working copy) |
@@ -1479,7 +1479,11 @@ |
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); |
} |