Reviewers: ulan,

Message:
Committed patchset #1 manually as r18693 (presubmit successful).

Description:
Experimental parser: tiny fix for silly code.

[email protected]
BUG=

Committed: https://code.google.com/p/v8/source/detail?r=18693

Please review this at https://codereview.chromium.org/143363003/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+4, -7 lines):
  M src/parser.cc


Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index d8813180d3ef2bebcba69aeb48663cb001641fa5..557fabb679d3c0551e6716ed8721cd9bad54971b 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -566,15 +566,12 @@ FunctionLiteral* Parser::ParseProgram() {
   // Initialize parser state.
   source = FlattenGetString(source);
   FunctionLiteral* result;
-  if (source->IsTwoByteRepresentation()) {
-    delete reusable_preparser_;
-    delete scanner_;
+  delete reusable_preparser_;
+  delete scanner_;
+  if (source->IsTwoByteRepresentation())
     scanner_ = new ExperimentalScanner<uint16_t>(source, isolate());
-  } else {
-    delete reusable_preparser_;
-    delete scanner_;
+  else
     scanner_ = new ExperimentalScanner<uint8_t>(source, isolate());
-  }
   SetScannerFlags();
   scanner_->Init();
   result = DoParseProgram(info(), source);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to