From d68a7de36a18db3da3ac92731d19a1592983effb Mon Sep 17 00:00:00 2001 From: Matthias Hausner Date: Tue, 8 Dec 2015 15:36:10 -0800 Subject: [PATCH] Fix mismatched parenthesis error message 'file:xxxx.dart': error: line 2 pos 4: unterminated '(' foo(state { // <= missing closing parenthesis ^ Also include a couple of postscripts from previous change. BUG=5830 R=iposva@google.com Review URL: https://codereview.chromium.org/1504313003 . --- runtime/vm/object.cc | 6 ++---- runtime/vm/parser.cc | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 7dd76e7c29e..2799c1b0ebf 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -9370,9 +9370,7 @@ void Library::RemovePatchClass(const Class& cls) const { // Library::LoadedScripts() can find it without having to iterate // over the members of each class. ASSERT(i < num_classes); // We must have found a class. - Class& pc = Class::Handle(); - pc ^= patch_classes.At(i); - const Script& patch_script = Script::Handle(pc.script()); + const Script& patch_script = Script::Handle(cls.script()); patch_classes.SetAt(i, patch_script); } @@ -9816,7 +9814,7 @@ RawArray* Library::LoadedScripts() const { owner_script = Class::Cast(entry).script(); } else { ASSERT(entry.IsScript()); - owner_script ^= Script::Cast(entry).raw(); + owner_script = Script::Cast(entry).raw(); } AddScriptIfUnique(scripts, owner_script); } diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc index 284e6a90627..bb163919211 100644 --- a/runtime/vm/parser.cc +++ b/runtime/vm/parser.cc @@ -1707,6 +1707,8 @@ void Parser::SkipToMatching() { is_match = opening_token == Token::kLBRACK; break; case Token::kEOS: + opening_token = token_stack.RemoveLast(); + opening_pos = token_pos_stack.RemoveLast(); unexpected_token_found = true; break; default: