| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 GET_NON_NULL_NATIVE_ARGUMENT(String, uri, arguments->NativeArgAt(0)); | 470 GET_NON_NULL_NATIVE_ARGUMENT(String, uri, arguments->NativeArgAt(0)); |
| 471 | 471 |
| 472 // Canonicalize the uri with respect to the current isolate. | 472 // Canonicalize the uri with respect to the current isolate. |
| 473 char* error = NULL; | 473 char* error = NULL; |
| 474 char* canonical_uri = NULL; | 474 char* canonical_uri = NULL; |
| 475 const Library& root_lib = | 475 const Library& root_lib = |
| 476 Library::Handle(arguments->isolate()->object_store()->root_library()); | 476 Library::Handle(arguments->isolate()->object_store()->root_library()); |
| 477 if (!CanonicalizeUri(arguments->isolate(), root_lib, uri, | 477 if (!CanonicalizeUri(arguments->isolate(), root_lib, uri, |
| 478 &canonical_uri, &error)) { | 478 &canonical_uri, &error)) { |
| 479 const String& msg = String::Handle(String::New(error)); | 479 const String& msg = String::Handle(String::New(error)); |
| 480 free(error); | |
| 481 ThrowIsolateSpawnException(msg); | 480 ThrowIsolateSpawnException(msg); |
| 482 } | 481 } |
| 483 | 482 |
| 484 return Spawn(arguments, new SpawnState(canonical_uri)); | 483 return Spawn(arguments, new SpawnState(canonical_uri)); |
| 485 } | 484 } |
| 486 | 485 |
| 487 | 486 |
| 488 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 487 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
| 489 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 488 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
| 490 if (port.IsError()) { | 489 if (port.IsError()) { |
| 491 Exceptions::PropagateError(Error::Cast(port)); | 490 Exceptions::PropagateError(Error::Cast(port)); |
| 492 } | 491 } |
| 493 return port.raw(); | 492 return port.raw(); |
| 494 } | 493 } |
| 495 | 494 |
| 496 } // namespace dart | 495 } // namespace dart |
| OLD | NEW |