From 061834200afbaacdf235e0a8210b597eba7fbb97 Mon Sep 17 00:00:00 2001 From: "christian.plesner.hansen@gmail.com" Date: Thu, 13 Aug 2009 10:25:35 +0000 Subject: [PATCH] Fixed issue 19212 Fixed a bug in json parsing. Refactored compilation code a bit to make it more obvious what's going on. Review URL: http://codereview.chromium.org/165446 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 31 +++++++++++++++++++++---------- src/compiler.h | 4 +++- src/runtime.cc | 15 ++++++++++----- test/mjsunit/json.js | 10 ++++++++++ 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index f0d97fe..5607f29 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -102,7 +102,7 @@ static Handle MakeCode(FunctionLiteral* literal, static bool IsValidJSON(FunctionLiteral* lit) { - if (!lit->body()->length() == 1) + if (lit->body()->length() != 1) return false; Statement* stmt = lit->body()->at(0); if (stmt->AsExpressionStatement() == NULL) @@ -114,7 +114,7 @@ static bool IsValidJSON(FunctionLiteral* lit) { static Handle MakeFunction(bool is_global, bool is_eval, - bool is_json, + Compiler::ValidationState validate, Handle