Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: src/api.cc

Issue 27701002: Expose v8::Function::IsBuiltin to public API. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4132 matching lines...) Expand 10 before | Expand all | Expand 10 after
4143 int Function::GetScriptColumnNumber() const { 4143 int Function::GetScriptColumnNumber() const {
4144 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); 4144 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
4145 if (func->shared()->script()->IsScript()) { 4145 if (func->shared()->script()->IsScript()) {
4146 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); 4146 i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
4147 return i::GetScriptColumnNumber(script, func->shared()->start_position()); 4147 return i::GetScriptColumnNumber(script, func->shared()->start_position());
4148 } 4148 }
4149 return kLineOffsetNotFound; 4149 return kLineOffsetNotFound;
4150 } 4150 }
4151 4151
4152 4152
4153 bool Function::IsBuiltin() const {
4154 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
4155 return func->IsBuiltin();
4156 }
4157
4158
4153 Handle<Value> Function::GetScriptId() const { 4159 Handle<Value> Function::GetScriptId() const {
4154 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); 4160 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
4155 i::Isolate* isolate = func->GetIsolate(); 4161 i::Isolate* isolate = func->GetIsolate();
4156 if (!func->shared()->script()->IsScript()) { 4162 if (!func->shared()->script()->IsScript()) {
4157 return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); 4163 return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
4158 } 4164 }
4159 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); 4165 i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
4160 return Utils::ToLocal(i::Handle<i::Object>(script->id(), isolate)); 4166 return Utils::ToLocal(i::Handle<i::Object>(script->id(), isolate));
4161 } 4167 }
4162 4168
(...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after
7545 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7551 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7546 Address callback_address = 7552 Address callback_address =
7547 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7553 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7548 VMState<EXTERNAL> state(isolate); 7554 VMState<EXTERNAL> state(isolate);
7549 ExternalCallbackScope call_scope(isolate, callback_address); 7555 ExternalCallbackScope call_scope(isolate, callback_address);
7550 callback(info); 7556 callback(info);
7551 } 7557 }
7552 7558
7553 7559
7554 } } // namespace v8::internal 7560 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698