TypeError: undefined is not a constructor
Categories
(Core :: IPC, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: surkov, Assigned: jdai)
Details
Attachments
(1 file)
There's a way to break a browser to make JS console (and terminal) errors are rather useless: no file, no line. For example,
TypeError: undefined is not a constructor
STRs:
- make not existing export in toolkit/actors, for example:
diff --git a/toolkit/actors/AutoCompleteChild.jsm b/toolkit/actors/AutoCompleteChild.jsm
--- a/toolkit/actors/AutoCompleteChild.jsm
+++ b/toolkit/actors/AutoCompleteChild.jsm
@@ -1,14 +1,14 @@
/* -- indent-tabs-mode: nil; js-indent-level: 2 -- /
/ This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-var EXPORTED_SYMBOLS = ["AutoCompleteChild"];
+var EXPORTED_SYMBOLS = ["AutoCompleteChildThrowError"];
I suppose no matter what, but console should show somewhat useful information. Otherwise no idea where to look what's broken.
Comment 1•5 years ago
|
||
Edgar, is DOM: Binding a better module for this issue? Any thoughts? Thank you.
Comment 2•5 years ago
|
||
It is about error reporting for .jsm, it doesn't look like belonging to DOM: Binding, maybe XPConnect.
Please feel free to switch to the right component if I am wrong.
Comment 3•4 years ago
|
||
This is coming from WindowGlobalActor::ConstructActor (https://searchfox.org/mozilla-central/rev/c7b673f443407a359cc0766fb5a4ac323a1d2628/dom/ipc/WindowGlobalActor.cpp#119). Maybe we should check for undefined and report an error before calling JS::Construct?
Assignee | ||
Comment 4•4 years ago
|
||
(In reply to Peter Van der Beken [:peterv] from comment #3)
This is coming from WindowGlobalActor::ConstructActor (https://searchfox.org/mozilla-central/rev/c7b673f443407a359cc0766fb5a4ac323a1d2628/dom/ipc/WindowGlobalActor.cpp#119). Maybe we should check for undefined and report an error before calling JS::Construct?
Yes, put it to my queue, I'll handle that.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Pushed by jdai@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf32a7162c2b Provide useful information while constructing JSWindowActor; r=nika
Comment 7•4 years ago
|
||
bugherder |
Description
•