libraries/v8/runtime.cc
// Changes the source of the script to a new_source.
// If old_script_name is provided (i.e. is a String), also creates a copy of
// the script with its original source and sends notification to debugger.
Changes the source of the script to a new_source.
If old_script_name is provided , also creates a copy of
the script with its original source and sends notification to debugger.
Changes the source of the script to a new_source . If old_script_name is provided also creates a copy of the script with its original source and sends notification to debugger .
RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditReplaceScript) {
  HandleScope scope(isolate);
  CHECK(isolate->debugger()->live_edit_enabled());
  ASSERT(args.length() == 3);
  CONVERT_ARG_CHECKED(JSValue, original_script_value, 0);
  CONVERT_ARG_HANDLE_CHECKED(String, new_source, 1);
  Handle<Object> old_script_name(args[2], isolate);
  RUNTIME_ASSERT(original_script_value->value()->IsScript());
  Handle<Script> original_script(Script::cast(original_script_value->value()));
  Object* old_script = LiveEdit::ChangeScriptSource(original_script,
                                                    new_source,
                                                    old_script_name);
  if (old_script->IsScript()) {
    Handle<Script> script_handle(Script::cast(old_script));
    return *(GetScriptWrapper(script_handle));
  } else {
    return isolate->heap()->null_value();
  }
}
RUNTIME_FUNCTION ( MaybeObject * , Runtime_LiveEditReplaceScript ) { HandleScope scope ( isolate ) ; CHECK ( isolate -> debugger ( ) -> live_edit_enabled ( ) ) ; ASSERT ( args . length ( ) == 3 ) ; CONVERT_ARG_CHECKED ( JSValue , original_script_value , 0 ) ; CONVERT_ARG_HANDLE_CHECKED ( String , new_source , 1 ) ; Handle < Object > old_script_name ( args [ 2 ] , isolate ) ; RUNTIME_ASSERT ( original_script_value -> value ( ) -> IsScript ( ) ) ; Handle < Script > original_script ( Script :: cast ( original_script_value -> value ( ) ) ) ; Object * old_script = LiveEdit :: ChangeScriptSource ( original_script , new_source , old_script_name ) ; if ( old_script -> IsScript ( ) ) { Handle < Script > script_handle ( Script :: cast ( old_script ) ) ; return * ( GetScriptWrapper ( script_handle ) ) ; } else { return isolate -> heap ( ) -> null_value ( ) ; } }
Changes the source of the script to a new_source.
Changes the source of the script to a new_source .