console.log(new(new Proxy(XPCNativeWrapper,{}))(1)) inside content script crashes tab
Categories
(Core :: XPConnect, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox98 | --- | verified |
People
(Reporter: alanas.00, Assigned: evilpies)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
Steps to reproduce:
- install greasemonkey: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
- create new greasemonkey script
- paste
console.log(new(new Proxy(XPCNativeWrapper,{}))(1))into userscript - visit web page like http://example.com/
Actual results:
Gah. Your tab just crashed.
Expected results:
1 apppears in devtools console (behaves same as console.log(new XPCNativeWrapper(1)))
question:
constructors can't return non-objects in javascript:
var A=new Proxy(function(){},{
"construct":function(){
return 1
}
})
var B=function(){
return 1
}
new A() //Uncaught TypeError: proxy [[Construct]] must return an object
new B() //Object { }
why does new XPCNativeWrapper(1) return number instead of object?
also XPCNativeWrapper works without new
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
(In reply to Release mgmt bot [:marco/ :calixte] from comment #1)
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
this is not devtools console bug
| Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
I've reproduced this bug using an affected Nightly build, and using the STR from comment 0.
The crash no longer occurs on a fixed build, Beta 98.0b9, under macOS 11, Win 10 x64 and Ubuntu 18.04 x64.
Description
•