summaryrefslogtreecommitdiff
path: root/js/src/vm/Debugger.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-16 11:35:57 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-16 11:35:57 +0100
commitaf300f36f11293c12f2ee01580fc749a7e114376 (patch)
tree71e6a6286a95069a805a254eb7abed9f7a83f0d4 /js/src/vm/Debugger.cpp
parent28d4e4a5fa5ba7a22d3497769fbb5a9d11db7a9e (diff)
downloaduxp-af300f36f11293c12f2ee01580fc749a7e114376.tar.gz
Bug 755821: Function() should use the parser's argument parsing code
Diffstat (limited to 'js/src/vm/Debugger.cpp')
-rw-r--r--js/src/vm/Debugger.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
index b6bc7d62af..4d181545f9 100644
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -6890,8 +6890,13 @@ class DebuggerSourceGetTextMatcher
bool hasSourceData = ss->hasSourceData();
if (!ss->hasSourceData() && !JSScript::loadSource(cx_, ss, &hasSourceData))
return nullptr;
- return hasSourceData ? ss->substring(cx_, 0, ss->length())
- : NewStringCopyZ<CanGC>(cx_, "[no source]");
+ if (!hasSourceData)
+ return NewStringCopyZ<CanGC>(cx_, "[no source]");
+
+ if (ss->isFunctionBody())
+ return ss->functionBodyString(cx_);
+
+ return ss->substring(cx_, 0, ss->length());
}
ReturnType match(Handle<WasmInstanceObject*> wasmInstance) {