Ensure that a string is flattened when entering JsonParser::ParseJson. Fixes issue v8:1572.

BUG=v8:1572
TEST=mjsunit/regress/regress-crbug-l84186.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
whesse@chromium.org 2011-07-27 14:34:59 +00:00
parent e4e83422bc
commit 4cba3faf71

View File

@ -166,7 +166,8 @@ class JsonParser BASE_EMBEDDED {
template <bool seq_ascii>
Handle<Object> JsonParser<seq_ascii>::ParseJson(Handle<String> source) {
isolate_ = source->map()->isolate();
source_ = Handle<String>(source->TryFlattenGetString());
FlattenString(source);
source_ = source;
source_length_ = source_->length();
// Optimized fast case where we only have ASCII characters.