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

Unified Diff: src/api.cc

Issue 316173002: Handle "//# sourceURL" comments in the Parser instead of the JS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: match ContentSearchUtils even more Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | src/messages.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index cfd952ecb2fb907d7e1783e58c78e18a8f9e88d6..767f9421d906194db4106756a6d26b0970d2f5a1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1631,6 +1631,38 @@ Handle<Value> UnboundScript::GetScriptName() {
}
+Handle<Value> UnboundScript::GetSourceURL() {
+ i::Handle<i::SharedFunctionInfo> obj =
+ i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
+ i::Isolate* isolate = obj->GetIsolate();
+ ON_BAILOUT(isolate, "v8::UnboundScript::GetSourceURL()",
+ return Handle<String>());
+ LOG_API(isolate, "UnboundScript::GetSourceURL");
+ if (obj->script()->IsScript()) {
+ i::Object* url = i::Script::cast(obj->script())->source_url();
+ return Utils::ToLocal(i::Handle<i::Object>(url, isolate));
+ } else {
+ return Handle<String>();
+ }
+}
+
+
+Handle<Value> UnboundScript::GetSourceMappingURL() {
+ i::Handle<i::SharedFunctionInfo> obj =
+ i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
+ i::Isolate* isolate = obj->GetIsolate();
+ ON_BAILOUT(isolate, "v8::UnboundScript::GetSourceMappingURL()",
+ return Handle<String>());
+ LOG_API(isolate, "UnboundScript::GetSourceMappingURL");
+ if (obj->script()->IsScript()) {
+ i::Object* url = i::Script::cast(obj->script())->source_mapping_url();
+ return Utils::ToLocal(i::Handle<i::Object>(url, isolate));
+ } else {
+ return Handle<String>();
+ }
+}
+
+
Local<Value> Script::Run() {
// If execution is terminating, Compile(..)->Run() requires this
// check.
« no previous file with comments | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | src/messages.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698