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

Side by Side Diff: runtime/bin/dartutils.cc

Issue 1152833002: Add a runtime flag to control availability of dart:mirrors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | runtime/vm/bootstrap.cc » ('j') | runtime/vm/dart.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return ResolveUri(library_url, url, builtin_lib); 385 return ResolveUri(library_url, url, builtin_lib);
386 } 386 }
387 387
388 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). 388 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:').
389 if (is_dart_scheme_url) { 389 if (is_dart_scheme_url) {
390 if (tag == Dart_kImportTag) { 390 if (tag == Dart_kImportTag) {
391 // Handle imports of other built-in libraries present in the SDK. 391 // Handle imports of other built-in libraries present in the SDK.
392 if (DartUtils::IsDartIOLibURL(url_string)) { 392 if (DartUtils::IsDartIOLibURL(url_string)) {
393 return Builtin::LoadLibrary(url, Builtin::kIOLibrary); 393 return Builtin::LoadLibrary(url, Builtin::kIOLibrary);
394 } 394 }
395 return NewError("The built-in library '%s' is not available" 395 return NewError("The built-in library '%s' is not available\n",
396 " on the stand-alone VM.\n", url_string); 396 url_string);
397 } else { 397 } else {
398 ASSERT(tag == Dart_kSourceTag); 398 ASSERT(tag == Dart_kSourceTag);
399 return NewError("Unable to load source '%s' ", url_string); 399 return NewError("Unable to load source '%s' ", url_string);
400 } 400 }
401 } 401 }
402 402
403 // Handle 'part' of IO library. 403 // Handle 'part' of IO library.
404 if (is_io_library) { 404 if (is_io_library) {
405 if (tag == Dart_kSourceTag) { 405 if (tag == Dart_kSourceTag) {
406 // Prepend the library URI to form a unique script URI for the part. 406 // Prepend the library URI to form a unique script URI for the part.
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 new CObjectString(CObject::NewString(os_error->message())); 1205 new CObjectString(CObject::NewString(os_error->message()));
1206 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 1206 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
1207 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 1207 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
1208 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 1208 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
1209 result->SetAt(2, error_message); 1209 result->SetAt(2, error_message);
1210 return result; 1210 return result;
1211 } 1211 }
1212 1212
1213 } // namespace bin 1213 } // namespace bin
1214 } // namespace dart 1214 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/bootstrap.cc » ('j') | runtime/vm/dart.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698