Chromium Code Reviews| Index: src/api.cc |
| =================================================================== |
| --- src/api.cc (revision 14209) |
| +++ src/api.cc (working copy) |
| @@ -1851,7 +1851,32 @@ |
| return Utils::ToLocal(id); |
| } |
|
danno
2013/04/11 13:33:46
nit: two empty lines here
|
| +int Script::GetLineNumber(int code_pos) { |
| + i::Isolate* isolate = i::Isolate::Current(); |
| + ON_BAILOUT(isolate, "v8::Script::GetLineNumber()", return -1); |
| + LOG_API(isolate, "Script::GetLineNumber"); |
| + i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| + if (obj->IsScript()) { |
| + i::Handle<i::Script> script = i::Handle<i::Script>(i::Script::cast(*obj)); |
| + return i::GetScriptLineNumber(script, code_pos); |
| + } else { |
| + return -1; |
| + } |
| +} |
|
danno
2013/04/11 13:33:46
nit: two empty lines here
|
| +Handle<Value> Script::GetScriptName() { |
| + i::Isolate* isolate = i::Isolate::Current(); |
| + ON_BAILOUT(isolate, "v8::Script::GetName()", return Handle<String>()); |
| + LOG_API(isolate, "Script::GetName"); |
| + i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| + if (obj->IsScript()) { |
| + i::Object* name = i::Script::cast(*obj)->name(); |
| + return Utils::ToLocal(i::Handle<i::Object>(name, isolate)); |
| + } else { |
| + return Handle<String>(); |
| + } |
| +} |
| + |
|
danno
2013/04/11 13:33:46
nit: two empty lines here
|
| void Script::SetData(v8::Handle<String> data) { |
| i::Isolate* isolate = i::Isolate::Current(); |
| ON_BAILOUT(isolate, "v8::Script::SetData()", return); |