summaryrefslogtreecommitdiffstats
path: root/js/xpconnect
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/xpconnect
parent28d4e4a5fa5ba7a22d3497769fbb5a9d11db7a9e (diff)
downloadUXP-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/xpconnect')
-rw-r--r--js/xpconnect/loader/mozJSSubScriptLoader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
index 824e9ab9e..9c8908ea4 100644
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -130,7 +130,9 @@ PrepareScript(nsIURI* uri,
MutableHandleFunction function)
{
JS::CompileOptions options(cx);
- options.setFileAndLine(uriStr, 1)
+ // Use line 0 to make the function body starts from line 1 when
+ // |reuseGlobal == true|.
+ options.setFileAndLine(uriStr, reuseGlobal ? 0 : 1)
.setVersion(JSVERSION_LATEST);
if (!charset.IsVoid()) {
char16_t* scriptBuf = nullptr;