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

Side by Side Diff: src/api.cc

Issue 8508008: Add getters for column number and script id to v8::Function (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/handles.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3601 matching lines...) Expand 10 before | Expand all | Expand 10 after
3612 int Function::GetScriptLineNumber() const { 3612 int Function::GetScriptLineNumber() const {
3613 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); 3613 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
3614 if (func->shared()->script()->IsScript()) { 3614 if (func->shared()->script()->IsScript()) {
3615 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); 3615 i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
3616 return i::GetScriptLineNumber(script, func->shared()->start_position()); 3616 return i::GetScriptLineNumber(script, func->shared()->start_position());
3617 } 3617 }
3618 return kLineOffsetNotFound; 3618 return kLineOffsetNotFound;
3619 } 3619 }
3620 3620
3621 3621
3622 int Function::GetScriptColumnNumber() const {
3623 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
3624 if (func->shared()->script()->IsScript()) {
3625 i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
3626 return i::GetScriptColumnNumber(script, func->shared()->start_position());
3627 }
3628 return kLineOffsetNotFound;
3629 }
3630
3631 Handle<Value> Function::GetScriptId() const {
3632 i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
3633 if (!func->shared()->script()->IsScript())
3634 return v8::Undefined();
3635 i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
3636 return Utils::ToLocal(i::Handle<i::Object>(script->id()));
3637 }
3638
3622 int String::Length() const { 3639 int String::Length() const {
3623 i::Handle<i::String> str = Utils::OpenHandle(this); 3640 i::Handle<i::String> str = Utils::OpenHandle(this);
3624 if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0; 3641 if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0;
3625 return str->length(); 3642 return str->length();
3626 } 3643 }
3627 3644
3628 3645
3629 int String::Utf8Length() const { 3646 int String::Utf8Length() const {
3630 i::Handle<i::String> str = Utils::OpenHandle(this); 3647 i::Handle<i::String> str = Utils::OpenHandle(this);
3631 if (IsDeadCheck(str->GetIsolate(), "v8::String::Utf8Length()")) return 0; 3648 if (IsDeadCheck(str->GetIsolate(), "v8::String::Utf8Length()")) return 0;
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after
6100 6117
6101 6118
6102 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6103 HandleScopeImplementer* scope_implementer = 6120 HandleScopeImplementer* scope_implementer =
6104 reinterpret_cast<HandleScopeImplementer*>(storage); 6121 reinterpret_cast<HandleScopeImplementer*>(storage);
6105 scope_implementer->IterateThis(v); 6122 scope_implementer->IterateThis(v);
6106 return storage + ArchiveSpacePerThread(); 6123 return storage + ArchiveSpacePerThread();
6107 } 6124 }
6108 6125
6109 } } // namespace v8::internal 6126 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698