| Index: runtime/vm/dart_api_impl.cc
|
| ===================================================================
|
| --- runtime/vm/dart_api_impl.cc (revision 36820)
|
| +++ runtime/vm/dart_api_impl.cc (working copy)
|
| @@ -51,6 +51,7 @@
|
| Dart_Handle Api::true_handle_ = NULL;
|
| Dart_Handle Api::false_handle_ = NULL;
|
| Dart_Handle Api::null_handle_ = NULL;
|
| +Dart_Handle Api::empty_string_handle_ = NULL;
|
|
|
|
|
| const char* CanonicalFunction(const char* func) {
|
| @@ -372,21 +373,6 @@
|
| }
|
|
|
|
|
| -Dart_Handle Api::Null() {
|
| - return null_handle_;
|
| -}
|
| -
|
| -
|
| -Dart_Handle Api::True() {
|
| - return true_handle_;
|
| -}
|
| -
|
| -
|
| -Dart_Handle Api::False() {
|
| - return false_handle_;
|
| -}
|
| -
|
| -
|
| ApiLocalScope* Api::TopScope(Isolate* isolate) {
|
| ASSERT(isolate != NULL);
|
| ApiState* state = isolate->api_state();
|
| @@ -418,6 +404,9 @@
|
|
|
| ASSERT(null_handle_ == NULL);
|
| null_handle_ = Api::InitNewHandle(isolate, Object::null());
|
| +
|
| + ASSERT(empty_string_handle_ == NULL);
|
| + empty_string_handle_ = Api::InitNewHandle(isolate, Symbols::Empty().raw());
|
| }
|
|
|
|
|
| @@ -1673,12 +1662,17 @@
|
| // --- Objects ----
|
|
|
| DART_EXPORT Dart_Handle Dart_Null() {
|
| - Isolate* isolate = Isolate::Current();
|
| - CHECK_ISOLATE(isolate);
|
| + ASSERT(Isolate::Current() != NULL);
|
| return Api::Null();
|
| }
|
|
|
|
|
| +DART_EXPORT Dart_Handle Dart_EmptyString() {
|
| + ASSERT(Isolate::Current() != NULL);
|
| + return Api::EmptyString();
|
| +}
|
| +
|
| +
|
| DART_EXPORT bool Dart_IsNull(Dart_Handle object) {
|
| return Api::UnwrapHandle(object) == Object::null();
|
| }
|
| @@ -2056,15 +2050,13 @@
|
| // --- Booleans ----
|
|
|
| DART_EXPORT Dart_Handle Dart_True() {
|
| - Isolate* isolate = Isolate::Current();
|
| - CHECK_ISOLATE(isolate);
|
| + ASSERT(Isolate::Current() != NULL);
|
| return Api::True();
|
| }
|
|
|
|
|
| DART_EXPORT Dart_Handle Dart_False() {
|
| - Isolate* isolate = Isolate::Current();
|
| - CHECK_ISOLATE(isolate);
|
| + ASSERT(Isolate::Current() != NULL);
|
| return Api::False();
|
| }
|
|
|
|
|