016214f002
R=johnmccutchan@google.com Review URL: https://codereview.chromium.org//1132153002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45664 260f80e4-7a28-3924-810f-c04153c831b5
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/bootstrap_natives.h"
|
|
|
|
#include "include/dart_api.h"
|
|
|
|
#include "vm/debugger.h"
|
|
#include "vm/exceptions.h"
|
|
#include "vm/native_entry.h"
|
|
#include "vm/object.h"
|
|
#include "vm/object_store.h"
|
|
#include "vm/service.h"
|
|
|
|
namespace dart {
|
|
|
|
// Native implementations for the dart:developer library.
|
|
|
|
DEFINE_NATIVE_ENTRY(Developer_debugger, 2) {
|
|
GET_NON_NULL_NATIVE_ARGUMENT(Bool, when, arguments->NativeArgAt(0));
|
|
GET_NATIVE_ARGUMENT(String, msg, arguments->NativeArgAt(1));
|
|
Debugger* debugger = isolate->debugger();
|
|
if (!debugger) {
|
|
return when.raw();
|
|
}
|
|
if (when.value()) {
|
|
debugger->BreakHere(msg);
|
|
}
|
|
return when.raw();
|
|
}
|
|
|
|
|
|
DEFINE_NATIVE_ENTRY(Developer_inspect, 1) {
|
|
GET_NATIVE_ARGUMENT(Instance, inspectee, arguments->NativeArgAt(0));
|
|
Service::SendInspectEvent(isolate, inspectee);
|
|
return inspectee.raw();
|
|
}
|
|
|
|
} // namespace dart
|