| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 7237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7248 RawObject* Library::Evaluate(const String& expr) const { | 7248 RawObject* Library::Evaluate(const String& expr) const { |
| 7249 // Make a fake top-level class and evaluate the expression | 7249 // Make a fake top-level class and evaluate the expression |
| 7250 // as a static function of the class. | 7250 // as a static function of the class. |
| 7251 Script& script = Script::Handle(); | 7251 Script& script = Script::Handle(); |
| 7252 script = Script::New(Symbols::Empty(), | 7252 script = Script::New(Symbols::Empty(), |
| 7253 Symbols::Empty(), | 7253 Symbols::Empty(), |
| 7254 RawScript::kSourceTag); | 7254 RawScript::kSourceTag); |
| 7255 Class& temp_class = | 7255 Class& temp_class = |
| 7256 Class::Handle(Class::New(Symbols::TopLevel(), script, 0)); | 7256 Class::Handle(Class::New(Symbols::TopLevel(), script, 0)); |
| 7257 temp_class.set_library(*this); | 7257 temp_class.set_library(*this); |
| 7258 temp_class.set_is_finalized(); |
| 7258 return temp_class.Evaluate(expr); | 7259 return temp_class.Evaluate(expr); |
| 7259 } | 7260 } |
| 7260 | 7261 |
| 7261 | 7262 |
| 7262 void Library::InitNativeWrappersLibrary(Isolate* isolate) { | 7263 void Library::InitNativeWrappersLibrary(Isolate* isolate) { |
| 7263 static const int kNumNativeWrappersClasses = 4; | 7264 static const int kNumNativeWrappersClasses = 4; |
| 7264 ASSERT(kNumNativeWrappersClasses > 0 && kNumNativeWrappersClasses < 10); | 7265 ASSERT(kNumNativeWrappersClasses > 0 && kNumNativeWrappersClasses < 10); |
| 7265 const String& native_flds_lib_url = Symbols::DartNativeWrappers(); | 7266 const String& native_flds_lib_url = Symbols::DartNativeWrappers(); |
| 7266 const Library& native_flds_lib = Library::Handle( | 7267 const Library& native_flds_lib = Library::Handle( |
| 7267 Library::NewLibraryHelper(native_flds_lib_url, false)); | 7268 Library::NewLibraryHelper(native_flds_lib_url, false)); |
| (...skipping 7657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14925 } | 14926 } |
| 14926 | 14927 |
| 14927 | 14928 |
| 14928 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14929 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14929 stream->OpenObject(); | 14930 stream->OpenObject(); |
| 14930 stream->CloseObject(); | 14931 stream->CloseObject(); |
| 14931 } | 14932 } |
| 14932 | 14933 |
| 14933 | 14934 |
| 14934 } // namespace dart | 14935 } // namespace dart |
| OLD | NEW |