Add process.crash() for both browser and renderer.

This commit is contained in:
Cheng Zhao 2013-06-01 16:06:29 +08:00
parent cd42fcceb9
commit cbb467032d
2 changed files with 8 additions and 0 deletions

View file

@ -22,6 +22,7 @@ void AtomBindings::BindTo(v8::Handle<v8::Object> process) {
v8::HandleScope scope;
node::SetMethod(process, "atomBinding", Binding);
node::SetMethod(process, "crash", Crash);
}
// static
@ -71,4 +72,10 @@ v8::Handle<v8::Value> AtomBindings::Binding(const v8::Arguments& args) {
v8::String::New("No such module")));
}
// static
v8::Handle<v8::Value> AtomBindings::Crash(const v8::Arguments& args) {
__builtin_trap();
return v8::Undefined();
}
} // namespace atom

View file

@ -21,6 +21,7 @@ class AtomBindings {
private:
static v8::Handle<v8::Value> Binding(const v8::Arguments& args);
static v8::Handle<v8::Value> Crash(const v8::Arguments& args);
DISALLOW_COPY_AND_ASSIGN(AtomBindings);
};