mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1108930 - Part 5: Call Map and Set with new in devtools. r=fitzgen
This commit is contained in:
parent
30b2ce0209
commit
29b35296cd
@ -28,7 +28,7 @@ const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {})
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["BrowserToolboxProcess"];
|
||||
|
||||
let processes = Set();
|
||||
let processes = new Set();
|
||||
|
||||
/**
|
||||
* Constructor for creating a process that will hold a chrome toolbox.
|
||||
|
@ -2116,7 +2116,7 @@ Scope.prototype = {
|
||||
// Creating maps and arrays thousands of times for variables or properties
|
||||
// with a large number of children fills up a lot of memory. Make sure
|
||||
// these are instantiated only if needed.
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Scope.prototype, "_store", Map);
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Scope.prototype, "_store", () => new Map());
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Scope.prototype, "_enumItems", Array);
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Scope.prototype, "_nonEnumItems", Array);
|
||||
|
||||
|
@ -617,7 +617,7 @@ Item.prototype = {
|
||||
|
||||
// Creating maps thousands of times for widgets with a large number of children
|
||||
// fills up a lot of memory. Make sure these are instantiated only if needed.
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Item.prototype, "_itemsByElement", Map);
|
||||
DevToolsUtils.defineLazyPrototypeGetter(Item.prototype, "_itemsByElement", () => new Map());
|
||||
|
||||
/**
|
||||
* Some generic Widget methods handling Item instances.
|
||||
|
@ -97,16 +97,16 @@ function markGCType(typeName, child, why, depth, ptrdness)
|
||||
|
||||
if (depth == 0) {
|
||||
if (!(typeName in gcTypes))
|
||||
gcTypes[typeName] = Set();
|
||||
gcTypes[typeName] = new Set();
|
||||
gcTypes[typeName].add(why);
|
||||
} else if (depth == 1) {
|
||||
if (!(typeName in gcPointers))
|
||||
gcPointers[typeName] = Set();
|
||||
gcPointers[typeName] = new Set();
|
||||
gcPointers[typeName].add(why);
|
||||
}
|
||||
|
||||
if (!(typeName in gcFields))
|
||||
gcFields[typeName] = Map();
|
||||
gcFields[typeName] = new Map();
|
||||
gcFields[typeName].set(why, [ child, ptrdness ]);
|
||||
|
||||
if (typeName in structureParents) {
|
||||
@ -148,7 +148,7 @@ addGCPointer('JS::AutoCheckCannotGC');
|
||||
|
||||
function explain(csu, indent, seen) {
|
||||
if (!seen)
|
||||
seen = Set();
|
||||
seen = new Set();
|
||||
seen.add(csu);
|
||||
if (!(csu in gcFields))
|
||||
return;
|
||||
|
@ -121,7 +121,7 @@ function test_find_actors() {
|
||||
|
||||
// All breakpoints
|
||||
|
||||
let bpSet = Set(bps);
|
||||
let bpSet = new Set(bps);
|
||||
for (let bp of bpStore.findActors()) {
|
||||
bpSet.delete(bp);
|
||||
}
|
||||
@ -130,7 +130,7 @@ function test_find_actors() {
|
||||
|
||||
// Breakpoints by URL
|
||||
|
||||
bpSet = Set(bps.filter(bp => { return bp.sourceActor.actorID === "actor1" }));
|
||||
bpSet = new Set(bps.filter(bp => { return bp.sourceActor.actorID === "actor1" }));
|
||||
for (let bp of bpStore.findActors({ sourceActor: { actorID: "actor1" } })) {
|
||||
bpSet.delete(bp);
|
||||
}
|
||||
@ -139,7 +139,7 @@ function test_find_actors() {
|
||||
|
||||
// Breakpoints by URL and line
|
||||
|
||||
bpSet = Set(bps.filter(bp => { return bp.sourceActor.actorID === "actor1" && bp.line === 10; }));
|
||||
bpSet = new Set(bps.filter(bp => { return bp.sourceActor.actorID === "actor1" && bp.line === 10; }));
|
||||
let first = true;
|
||||
for (let bp of bpStore.findActors({ sourceActor: { actorID: "actor1" }, line: 10 })) {
|
||||
if (first) {
|
||||
|
@ -104,7 +104,7 @@ function tryActors(aReachables, aCompleted) {
|
||||
*/
|
||||
function TestNoForwardingYet()
|
||||
{
|
||||
tryActors(Set(['root']), run_next_test);
|
||||
tryActors(new Set(['root']), run_next_test);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -138,7 +138,7 @@ function createSubconnection1()
|
||||
// Establish forwarding, but don't put any actors in that server.
|
||||
function TestForwardPrefix1OnlyRoot()
|
||||
{
|
||||
tryActors(Set(['root', 'prefix1/root']), run_next_test);
|
||||
tryActors(new Set(['root', 'prefix1/root']), run_next_test);
|
||||
}
|
||||
|
||||
/* Create a third root actor, to which we can forward things. */
|
||||
@ -152,7 +152,7 @@ function createSubconnection2()
|
||||
|
||||
function TestForwardPrefix12OnlyRoot()
|
||||
{
|
||||
tryActors(Set(['root', 'prefix1/root', 'prefix2/root']), run_next_test);
|
||||
tryActors(new Set(['root', 'prefix1/root', 'prefix2/root']), run_next_test);
|
||||
}
|
||||
|
||||
// A dumb actor that implements 'echo'.
|
||||
@ -183,7 +183,7 @@ function TestForwardPrefix12WithActor1()
|
||||
actor.actorID = 'prefix1/actor';
|
||||
gSubconnection1.addActor(actor);
|
||||
|
||||
tryActors(Set(['root', 'prefix1/root', 'prefix1/actor', 'prefix2/root']), run_next_test);
|
||||
tryActors(new Set(['root', 'prefix1/root', 'prefix1/actor', 'prefix2/root']), run_next_test);
|
||||
}
|
||||
|
||||
function TestForwardPrefix12WithActor12()
|
||||
@ -192,5 +192,5 @@ function TestForwardPrefix12WithActor12()
|
||||
actor.actorID = 'prefix2/actor';
|
||||
gSubconnection2.addActor(actor);
|
||||
|
||||
tryActors(Set(['root', 'prefix1/root', 'prefix1/actor', 'prefix2/root', 'prefix2/actor']), run_next_test);
|
||||
tryActors(new Set(['root', 'prefix1/root', 'prefix1/actor', 'prefix2/root', 'prefix2/actor']), run_next_test);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user