| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4371 Dart_LibraryTagHandler handler = isolate()->library_tag_handler(); | 4371 Dart_LibraryTagHandler handler = isolate()->library_tag_handler(); |
| 4372 if (handler == NULL) { | 4372 if (handler == NULL) { |
| 4373 if (url.StartsWith(Symbols::DartScheme())) { | 4373 if (url.StartsWith(Symbols::DartScheme())) { |
| 4374 if (tag == Dart_kCanonicalizeUrl) { | 4374 if (tag == Dart_kCanonicalizeUrl) { |
| 4375 return url.raw(); | 4375 return url.raw(); |
| 4376 } | 4376 } |
| 4377 return Object::null(); | 4377 return Object::null(); |
| 4378 } | 4378 } |
| 4379 ErrorMsg(token_pos, "no library handler registered"); | 4379 ErrorMsg(token_pos, "no library handler registered"); |
| 4380 } | 4380 } |
| 4381 // Block class finalization attempts when calling into the library |
| 4382 // tag handler. |
| 4383 isolate()->BlockClassFinalization(); |
| 4381 Dart_Handle result = handler(tag, | 4384 Dart_Handle result = handler(tag, |
| 4382 Api::NewHandle(isolate(), library_.raw()), | 4385 Api::NewHandle(isolate(), library_.raw()), |
| 4383 Api::NewHandle(isolate(), url.raw())); | 4386 Api::NewHandle(isolate(), url.raw())); |
| 4387 isolate()->UnblockClassFinalization(); |
| 4384 if (Dart_IsError(result)) { | 4388 if (Dart_IsError(result)) { |
| 4385 // In case of an error we append an explanatory error message to the | 4389 // In case of an error we append an explanatory error message to the |
| 4386 // error obtained from the library tag handler. | 4390 // error obtained from the library tag handler. |
| 4387 Error& prev_error = Error::Handle(); | 4391 Error& prev_error = Error::Handle(); |
| 4388 prev_error ^= Api::UnwrapHandle(result); | 4392 prev_error ^= Api::UnwrapHandle(result); |
| 4389 AppendErrorMsg(prev_error, token_pos, "library handler failed"); | 4393 AppendErrorMsg(prev_error, token_pos, "library handler failed"); |
| 4390 } | 4394 } |
| 4391 if (tag == Dart_kCanonicalizeUrl) { | 4395 if (tag == Dart_kCanonicalizeUrl) { |
| 4392 if (!Dart_IsString(result)) { | 4396 if (!Dart_IsString(result)) { |
| 4393 ErrorMsg(token_pos, "library handler failed URI canonicalization"); | 4397 ErrorMsg(token_pos, "library handler failed URI canonicalization"); |
| (...skipping 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10105 void Parser::SkipQualIdent() { | 10109 void Parser::SkipQualIdent() { |
| 10106 ASSERT(IsIdentifier()); | 10110 ASSERT(IsIdentifier()); |
| 10107 ConsumeToken(); | 10111 ConsumeToken(); |
| 10108 if (CurrentToken() == Token::kPERIOD) { | 10112 if (CurrentToken() == Token::kPERIOD) { |
| 10109 ConsumeToken(); // Consume the kPERIOD token. | 10113 ConsumeToken(); // Consume the kPERIOD token. |
| 10110 ExpectIdentifier("identifier expected after '.'"); | 10114 ExpectIdentifier("identifier expected after '.'"); |
| 10111 } | 10115 } |
| 10112 } | 10116 } |
| 10113 | 10117 |
| 10114 } // namespace dart | 10118 } // namespace dart |
| OLD | NEW |