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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // TODO(turnidge): Throw an exception when the return value is false? | 143 // TODO(turnidge): Throw an exception when the return value is false? |
144 PortMap::PostMessage(new Message(send_id.Value(), reply_id.Value(), | 144 PortMap::PostMessage(new Message(send_id.Value(), reply_id.Value(), |
145 data, writer.BytesWritten(), | 145 data, writer.BytesWritten(), |
146 Message::kNormalPriority)); | 146 Message::kNormalPriority)); |
147 return Object::null(); | 147 return Object::null(); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 static void ThrowIllegalArgException(const String& message) { | 151 static void ThrowIllegalArgException(const String& message) { |
152 GrowableArray<const Object*> args(1); | 152 const Array& args = Array::Handle(Array::New(1)); |
153 args.Add(&message); | 153 args.SetAt(0, message); |
154 Exceptions::ThrowByType(Exceptions::kArgument, args); | 154 Exceptions::ThrowByType(Exceptions::kArgument, args); |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 static void ThrowIsolateSpawnException(const String& message) { | 158 static void ThrowIsolateSpawnException(const String& message) { |
159 GrowableArray<const Object*> args(1); | 159 const Array& args = Array::Handle(Array::New(1)); |
160 args.Add(&message); | 160 args.SetAt(0, message); |
161 Exceptions::ThrowByType(Exceptions::kIsolateSpawn, args); | 161 Exceptions::ThrowByType(Exceptions::kIsolateSpawn, args); |
162 } | 162 } |
163 | 163 |
164 | 164 |
165 static bool CanonicalizeUri(Isolate* isolate, | 165 static bool CanonicalizeUri(Isolate* isolate, |
166 const Library& library, | 166 const Library& library, |
167 const String& uri, | 167 const String& uri, |
168 char** canonical_uri, | 168 char** canonical_uri, |
169 char** error) { | 169 char** error) { |
170 Zone* zone = isolate->current_zone(); | 170 Zone* zone = isolate->current_zone(); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 488 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
489 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 489 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
490 if (port.IsError()) { | 490 if (port.IsError()) { |
491 Exceptions::PropagateError(Error::Cast(port)); | 491 Exceptions::PropagateError(Error::Cast(port)); |
492 } | 492 } |
493 return port.raw(); | 493 return port.raw(); |
494 } | 494 } |
495 | 495 |
496 } // namespace dart | 496 } // namespace dart |
OLD | NEW |