Commit 6302fc67 authored by yurys@chromium.org's avatar yurys@chromium.org

Add ScriptID field into ScriptOrigin class.

Anonymous script has empty resource name. To identify this script we need its id.

R=ulan@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/363553005

Patch from Alexey Kozyatinskiy <kozyatinskiy@google.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22248 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2dd6e2af
...@@ -916,20 +916,24 @@ class ScriptOrigin { ...@@ -916,20 +916,24 @@ class ScriptOrigin {
Handle<Value> resource_name, Handle<Value> resource_name,
Handle<Integer> resource_line_offset = Handle<Integer>(), Handle<Integer> resource_line_offset = Handle<Integer>(),
Handle<Integer> resource_column_offset = Handle<Integer>(), Handle<Integer> resource_column_offset = Handle<Integer>(),
Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>()) Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>(),
Handle<Integer> script_id = Handle<Integer>())
: resource_name_(resource_name), : resource_name_(resource_name),
resource_line_offset_(resource_line_offset), resource_line_offset_(resource_line_offset),
resource_column_offset_(resource_column_offset), resource_column_offset_(resource_column_offset),
resource_is_shared_cross_origin_(resource_is_shared_cross_origin) { } resource_is_shared_cross_origin_(resource_is_shared_cross_origin),
script_id_(script_id) { }
V8_INLINE Handle<Value> ResourceName() const; V8_INLINE Handle<Value> ResourceName() const;
V8_INLINE Handle<Integer> ResourceLineOffset() const; V8_INLINE Handle<Integer> ResourceLineOffset() const;
V8_INLINE Handle<Integer> ResourceColumnOffset() const; V8_INLINE Handle<Integer> ResourceColumnOffset() const;
V8_INLINE Handle<Boolean> ResourceIsSharedCrossOrigin() const; V8_INLINE Handle<Boolean> ResourceIsSharedCrossOrigin() const;
V8_INLINE Handle<Integer> ScriptID() const;
private: private:
Handle<Value> resource_name_; Handle<Value> resource_name_;
Handle<Integer> resource_line_offset_; Handle<Integer> resource_line_offset_;
Handle<Integer> resource_column_offset_; Handle<Integer> resource_column_offset_;
Handle<Boolean> resource_is_shared_cross_origin_; Handle<Boolean> resource_is_shared_cross_origin_;
Handle<Integer> script_id_;
}; };
...@@ -6147,11 +6151,17 @@ Handle<Integer> ScriptOrigin::ResourceColumnOffset() const { ...@@ -6147,11 +6151,17 @@ Handle<Integer> ScriptOrigin::ResourceColumnOffset() const {
return resource_column_offset_; return resource_column_offset_;
} }
Handle<Boolean> ScriptOrigin::ResourceIsSharedCrossOrigin() const { Handle<Boolean> ScriptOrigin::ResourceIsSharedCrossOrigin() const {
return resource_is_shared_cross_origin_; return resource_is_shared_cross_origin_;
} }
Handle<Integer> ScriptOrigin::ScriptID() const {
return script_id_;
}
ScriptCompiler::Source::Source(Local<String> string, const ScriptOrigin& origin, ScriptCompiler::Source::Source(Local<String> string, const ScriptOrigin& origin,
CachedData* data) CachedData* data)
: source_string(string), : source_string(string),
......
...@@ -1998,7 +1998,9 @@ ScriptOrigin Message::GetScriptOrigin() const { ...@@ -1998,7 +1998,9 @@ ScriptOrigin Message::GetScriptOrigin() const {
v8::ScriptOrigin origin( v8::ScriptOrigin origin(
Utils::ToLocal(scriptName), Utils::ToLocal(scriptName),
v8::Integer::New(v8_isolate, script->line_offset()->value()), v8::Integer::New(v8_isolate, script->line_offset()->value()),
v8::Integer::New(v8_isolate, script->column_offset()->value())); v8::Integer::New(v8_isolate, script->column_offset()->value()),
Handle<Boolean>(),
v8::Integer::New(v8_isolate, script->id()->value()));
return origin; return origin;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment