| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
| 8 #include "vm/native_entry.h" | 8 #include "vm/native_entry.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/stack_frame.h" | 10 #include "vm/stack_frame.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 StackFrame* caller_frame = iterator.NextFrame(); | 87 StackFrame* caller_frame = iterator.NextFrame(); |
| 88 ASSERT(caller_frame != NULL); | 88 ASSERT(caller_frame != NULL); |
| 89 const intptr_t location = caller_frame->GetTokenPos(); | 89 const intptr_t location = caller_frame->GetTokenPos(); |
| 90 String& malformed_error_message = String::Handle( | 90 String& malformed_error_message = String::Handle( |
| 91 String::New(malformed_error.ToErrorCString())); | 91 String::New(malformed_error.ToErrorCString())); |
| 92 Exceptions::CreateAndThrowTypeError( | 92 Exceptions::CreateAndThrowTypeError( |
| 93 location, Symbols::Empty(), Symbols::Empty(), | 93 location, Symbols::Empty(), Symbols::Empty(), |
| 94 Symbols::Empty(), malformed_error_message); | 94 Symbols::Empty(), malformed_error_message); |
| 95 UNREACHABLE(); | 95 UNREACHABLE(); |
| 96 } | 96 } |
| 97 if (negate.value()) { | 97 return Bool::Get(negate.value() ? !is_instance_of : is_instance_of); |
| 98 return is_instance_of ? Bool::False() : Bool::True(); | |
| 99 } else { | |
| 100 return is_instance_of ? Bool::True() : Bool::False(); | |
| 101 } | |
| 102 } | 98 } |
| 103 | 99 |
| 104 | 100 |
| 105 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { | 101 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { |
| 106 const AbstractType& type = | 102 const AbstractType& type = |
| 107 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); | 103 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); |
| 108 return type.UserVisibleName(); | 104 return type.UserVisibleName(); |
| 109 } | 105 } |
| 110 | 106 |
| 111 } // namespace dart | 107 } // namespace dart |
| OLD | NEW |