diff --git a/src/objects/script-inl.h b/src/objects/script-inl.h index 4dd8bed382..1e2d6166d1 100644 --- a/src/objects/script-inl.h +++ b/src/objects/script-inl.h @@ -175,6 +175,10 @@ bool Script::HasValidSource() { return true; } +bool Script::HasSourceURLComment() const { + return source_url().IsString() && String::cast(source_url()).length() != 0; +} + } // namespace internal } // namespace v8 diff --git a/src/objects/script.h b/src/objects/script.h index 3d2ff73b99..a9ebf4649e 100644 --- a/src/objects/script.h +++ b/src/objects/script.h @@ -142,6 +142,9 @@ class Script : public TorqueGeneratedScript { // resource is accessible. Otherwise, always return true. inline bool HasValidSource(); + // If the script has a non-empty sourceURL comment. + inline bool HasSourceURLComment() const; + Object GetNameOrSourceURL(); // Retrieve source position from where eval was called. diff --git a/src/objects/stack-frame-info.cc b/src/objects/stack-frame-info.cc index 08675bc49e..99ee0b394f 100644 --- a/src/objects/stack-frame-info.cc +++ b/src/objects/stack-frame-info.cc @@ -68,7 +68,11 @@ int StackFrameInfo::GetLineNumber(Handle info) { Handle