Native scripts do not appear in backtraces, or in the source and
line number when exceptions are thrown from within them. This is
useful to be able to write code in JavaScript instead of C++ and
still have it appear sensibly to the user.
Change-Id: I93b7b9f0d93ff38204332be6544b1309082b2720
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
class V8EXPORT Script {
public:
enum CompileFlags {
- Default = 0x00,
- QmlMode = 0x01
+ Default = 0x00,
+ QmlMode = 0x01,
+ NativeMode = 0x02
};
/**
// Create a script object describing the script to be compiled.
Handle<Script> script = FACTORY->NewScript(source);
- if (natives == NATIVES_CODE) {
+ if (natives == NATIVES_CODE || compile_flags & v8::Script::NativeMode) {
script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
}
if (!script_name.is_null()) {