summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-18 17:54:38 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-03-18 17:56:16 +0100
commit122938a4398ae8db07060dca3561ff46f93b5925 (patch)
tree965b4bcf2ea8133c172170cf66e5c87cf1e17df3 /dom
parentdda392cd4edb3258889188af5a5644eb8d36aeb7 (diff)
parentaf300f36f11293c12f2ee01580fc749a7e114376 (diff)
downloadUXP-122938a4398ae8db07060dca3561ff46f93b5925.tar
UXP-122938a4398ae8db07060dca3561ff46f93b5925.tar.gz
UXP-122938a4398ae8db07060dca3561ff46f93b5925.tar.lz
UXP-122938a4398ae8db07060dca3561ff46f93b5925.tar.xz
UXP-122938a4398ae8db07060dca3561ff46f93b5925.zip
Support ES6's "new function" construct
This resolves #75. Merged remote-tracking branch 'janek/js_function_new_1'
Diffstat (limited to 'dom')
-rw-r--r--dom/events/EventListenerManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp
index c8db4f2a1..a8c48ede8 100644
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -996,14 +996,12 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener,
}
aListener = nullptr;
- uint32_t lineNo = 0;
nsAutoCString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener"));
MOZ_ASSERT(body);
MOZ_ASSERT(aElement);
nsIURI *uri = aElement->OwnerDoc()->GetDocumentURI();
if (uri) {
uri->GetSpec(url);
- lineNo = 1;
}
nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(mTarget);
@@ -1073,8 +1071,9 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener,
return NS_ERROR_FAILURE;
}
JS::CompileOptions options(cx);
+ // Use line 0 to make the function body starts from line 1.
options.setIntroductionType("eventHandler")
- .setFileAndLine(url.get(), lineNo)
+ .setFileAndLine(url.get(), 0)
.setVersion(JSVERSION_DEFAULT)
.setElement(&v.toObject())
.setElementAttributeName(jsStr);