diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-16 11:35:57 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-16 11:35:57 +0100 |
commit | af300f36f11293c12f2ee01580fc749a7e114376 (patch) | |
tree | 71e6a6286a95069a805a254eb7abed9f7a83f0d4 /js/src/vm/Debugger.cpp | |
parent | 28d4e4a5fa5ba7a22d3497769fbb5a9d11db7a9e (diff) | |
download | UXP-af300f36f11293c12f2ee01580fc749a7e114376.tar UXP-af300f36f11293c12f2ee01580fc749a7e114376.tar.gz UXP-af300f36f11293c12f2ee01580fc749a7e114376.tar.lz UXP-af300f36f11293c12f2ee01580fc749a7e114376.tar.xz UXP-af300f36f11293c12f2ee01580fc749a7e114376.zip |
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.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index b6bc7d62a..4d181545f 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) { |