Closed Bug 1178052 Opened 5 years ago Closed 5 months ago

test_predictor.js: "TypeError: "Cu" is read-only" (also for "Cr", "Ci", "Cc")

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ishikawa, Unassigned)

Details

I have noticed that a set of new JavaScript Warning messages
show up in the log of |make xpcshell-tests| of C-C TB when I execuited
the test on a local PC.
These messages are new.

Here is the summary (searched and sorted) from the log.

      4 "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "TypeError: "Cu" is read-only" {file: "/NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js" line: 3}]"

      4 "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "TypeError: "Cr" is read-only" {file: "/NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js" line: 4}]"

      4 "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "TypeError: "Ci" is read-only" {file: "/NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js" line: 2}]"

      4 "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "TypeError: "Cc" is read-only" {file: "/NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js" line: 1}]"

      2 PROCESS | 9415 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 4: TypeError: "Cr" is read-only

      2 PROCESS | 9415 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 3: TypeError: "Cu" is read-only

      2 PROCESS | 9415 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 2: TypeError: "Ci" is read-only

      2 PROCESS | 9415 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 1: TypeError: "Cc" is read-only

      2 PROCESS | 9367 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 4: TypeError: "Cr" is read-only

      2 PROCESS | 9367 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 3: TypeError: "Cu" is read-only

      2 PROCESS | 9367 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 2: TypeError: "Ci" is read-only

      2 PROCESS | 9367 | JavaScript strict warning: /NREF-COMM-CENTRAL/objdir-tb3/_tests/xpcshell/netwerk/test/unit/test_predictor.js, line 1: TypeError: "Cc" is read-only


This set of warnings is very new.

The code in question looks like this:

var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;

Maybe Cc, Ci, Cu, Cr have been declared in an outer scope where
this test is executed as const  or something???

A file, head_cache2.js,  under the same directory as
test_predictor.js,
has the following lines at the beginning:
--- begin quote
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
--- end quote

test_about_protocol.js: line 6:
let Cc = Components.classes;

However, I see a few files that declare Cc as "Var". Very confusing.
test_bug336501.js: line 1:
var Cc = Components.classes;

cf.
grep "Cc =" *.js
head_cache2.js:const Cc = Components.classes;
socks_client_subprocess.js:const Cc = Components.classes;
test_about_protocol.js:let Cc = Components.classes;
test_bug336501.js:var Cc = Components.classes;
test_bug376660.js:var Cc = Components.classes;
test_bug427957.js:var Cc = Components.classes;
test_filestreams.js:let Cc = Components.classes;
test_http2.js:var Cc = Components.classes;
test_mozTXTToHTMLConv.js:var Cc = Components.classes;
test_predictor.js:var Cc = Components.classes;
test_standardurl_port.js:var Cc = Components.classes;
test_tldservice_nextsubdomain.js:var Cc = Components.classes;

I wonder if this has anything to do with
bug 1176612 TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit/test_predictor.js | Test timed out

TIA
See Also: → 1176612
Should be unrelated. But yes, test_predictor.js shouldn't declare those as head_cache2.j already declares them (as consts).
See Also: 1176612

Seems fixed.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.