Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: runtime/vm/regexp_parser.cc

Issue 1672853002: Move sticky_error_ from isolate to thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments addressed Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/service_isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/longjump.h" 5 #include "vm/longjump.h"
6 #include "vm/object_store.h" 6 #include "vm/object_store.h"
7 #include "vm/regexp_parser.h" 7 #include "vm/regexp_parser.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 RegExpTree* tree = parser.ParsePattern(); 1057 RegExpTree* tree = parser.ParsePattern();
1058 ASSERT(tree != NULL); 1058 ASSERT(tree != NULL);
1059 ASSERT(result->error.IsNull()); 1059 ASSERT(result->error.IsNull());
1060 result->tree = tree; 1060 result->tree = tree;
1061 intptr_t capture_count = parser.captures_started(); 1061 intptr_t capture_count = parser.captures_started();
1062 result->simple = tree->IsAtom() && parser.simple() && capture_count == 0; 1062 result->simple = tree->IsAtom() && parser.simple() && capture_count == 0;
1063 result->contains_anchor = parser.contains_anchor(); 1063 result->contains_anchor = parser.contains_anchor();
1064 result->capture_count = capture_count; 1064 result->capture_count = capture_count;
1065 } else { 1065 } else {
1066 ASSERT(!result->error.IsNull()); 1066 ASSERT(!result->error.IsNull());
1067 Isolate::Current()->object_store()->clear_sticky_error(); 1067 Thread::Current()->clear_sticky_error();
1068 1068
1069 // Throw a FormatException on parsing failures. 1069 // Throw a FormatException on parsing failures.
1070 const String& message = String::Handle( 1070 const String& message = String::Handle(
1071 String::Concat(result->error, input)); 1071 String::Concat(result->error, input));
1072 const Array& args = Array::Handle(Array::New(1)); 1072 const Array& args = Array::Handle(Array::New(1));
1073 args.SetAt(0, message); 1073 args.SetAt(0, message);
1074 1074
1075 Exceptions::ThrowByType(Exceptions::kFormat, args); 1075 Exceptions::ThrowByType(Exceptions::kFormat, args);
1076 } 1076 }
1077 return !parser.failed(); 1077 return !parser.failed();
1078 } 1078 }
1079 1079
1080 } // namespace dart 1080 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/service_isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698