Debug.setBreakPoint = function(func, opt_line, opt_column, opt_condition) {
if (!IS_FUNCTION(func)) throw new Error('Parameters have wrong types.');
+ // Break points in API functions are not supported.
+ if (%FunctionIsAPIFunction(func)) {
+ throw new Error('Cannot set break point in native code.');
+ }
var source_position = this.findFunctionSourcePosition(func, opt_line, opt_column) -
this.sourcePosition(func);
// Find the script for the function.
var script = %FunctionGetScript(func);
+ // Break in builtin JavaScript code is not supported.
+ if (script.type == Debug.ScriptType.Native) {
+ throw new Error('Cannot set break point in native code.');
+ }
// If the script for the function has a name convert this to a script break
// point.
if (script && script.name) {
}
+static Object* Runtime_FunctionIsAPIFunction(Arguments args) {
+ NoHandleAllocation ha;
+ ASSERT(args.length() == 1);
+
+ CONVERT_CHECKED(JSFunction, f, args[0]);
+ // The function_data field of the shared function info is used exclusively by
+ // the API.
+ return !f->shared()->function_data()->IsUndefined() ? Heap::true_value()
+ : Heap::false_value();
+}
+
+
static Object* Runtime_SetCode(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 2);
F(FunctionGetSourceCode, 1) \
F(FunctionGetScript, 1) \
F(FunctionGetScriptSourcePosition, 1) \
+ F(FunctionIsAPIFunction, 1) \
F(GetScript, 1) \
\
F(ClassOf, 1) \