mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Bug 755821: Function() should use the parser's argument parsing code
This commit is contained in:
parent
e7fdd26fde
commit
0e7a16c088
24 changed files with 321 additions and 469 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue