Permalink
Browse files

RunFile: set script location information for debugging

  • Loading branch information...
1 parent e3df419 commit 682784abecebf0db7f085e0972bc940a1ff54588 jpike committed Mar 15, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −0 src/vu8/CMakeLists.txt
  2. +5 −2 src/vu8/Context.cpp
View
1 src/vu8/CMakeLists.txt
@@ -18,6 +18,7 @@ set(VU8_PP_ITERATION_LIMIT 10 CACHE STRING
set(CMAKE_CXX_FLAGS "-Wall")
+# add_definitions(-fuse-cxa-atexit)
if(VU8_FORCE_32)
set(VU8_ARCH ia32)
add_definitions(-m32)
View
7 src/vu8/Context.cpp
@@ -117,8 +117,11 @@ void Context::RunFile(char const *filename) {
scriptStream << line << '\n';
}
- v8::Handle<v8::Script> script =
- v8::Script::Compile(v8::String::New(scriptStream.str().c_str()));
+ std::auto_ptr<v8::ScriptOrigin> origin(
+ new v8::ScriptOrigin(v8::String::New(filename)));
+
+ v8::Handle<v8::Script> script = v8::Script::Compile(
+ v8::String::New(scriptStream.str().c_str()), origin.get());
script->Run();
}

0 comments on commit 682784a

Please sign in to comment.