libraries/v8/runtime.cc
// Patches script source (should be called upon BeforeCompile event).
Patches script source (should be called upon BeforeCompile event).
Patches script source ( should be called upon BeforeCompile event ) .
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) {
  HandleScope scope(isolate);
  ASSERT(args.length() == 2);
  CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0);
  CONVERT_ARG_HANDLE_CHECKED(String, source, 1);
  RUNTIME_ASSERT(script_wrapper->value()->IsScript());
  Handle<Script> script(Script::cast(script_wrapper->value()));
  int compilation_state = script->compilation_state();
  RUNTIME_ASSERT(compilation_state == Script::COMPILATION_STATE_INITIAL);
  script->set_source(*source);
  return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION ( MaybeObject * , Runtime_DebugSetScriptSource ) { HandleScope scope ( isolate ) ; ASSERT ( args . length ( ) == 2 ) ; CONVERT_ARG_HANDLE_CHECKED ( JSValue , script_wrapper , 0 ) ; CONVERT_ARG_HANDLE_CHECKED ( String , source , 1 ) ; RUNTIME_ASSERT ( script_wrapper -> value ( ) -> IsScript ( ) ) ; Handle < Script > script ( Script :: cast ( script_wrapper -> value ( ) ) ) ; int compilation_state = script -> compilation_state ( ) ; RUNTIME_ASSERT ( compilation_state == Script :: COMPILATION_STATE_INITIAL ) ; script -> set_source ( * source ) ; return isolate -> heap ( ) -> undefined_value ( ) ; }
Patches script source (should be called upon BeforeCompile event).
Patches script source ( should be called upon BeforeCompile event ) .