Have you tried using your favorite debugger to get a backtrace? That should help you figure out what's going on.
On Wed, Dec 12, 2012 at 5:41 PM, Paul Harris <[email protected]> wrote: > Hello again, > > I'm seeing a crash that seems a bit strange. > > I adjusted d8.cc's Load method so that it returns the result of the script > execution, like so: > > Handle<Value> Shell::Load(const Arguments& args) { > HandleScope handle_scope; > String::Utf8Value file(args[0]); > if (*file == NULL) { > return ThrowException(String::New("Error loading file")); > } > Handle<String> source = ReadFile(*file); > if (source.IsEmpty()) { > return ThrowException(String::New("Error loading file")); > } > TryCatch try_catch; > options.script_executed = true; > Handle<Script> script = Script::Compile(source); > if (script.IsEmpty()) { > // Print errors that happened during compilation. > ReportException(&try_catch); > return Undefined(); > } else { > Handle<Value> result = script->Run(); > if (result.IsEmpty()) { > ASSERT(try_catch.HasCaught()); > // Print errors that happened during execution. > ReportException(&try_catch); > return Undefined(); > } else { > ASSERT(!try_catch.HasCaught()); > return result; > } > } > } > > > Then I compiled. In the same folder as d8.exe, saved this into the file > "hi.js" > ---- hi.js --- > (function() {}); > ------------- > > Then I ran d8.exe and did this: > > new load('hi.js')(); > > Which results in a hard crash, in both Debug and Release versions (on > windows). > > Surely it should just be an 'not a function' error or something like that? > > cheers, > Paul > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
