sdk/core/namespace.js causes unsafe CPOW usage warnings

RESOLVED INCOMPLETE

Status

Add-on SDK
General
RESOLVED INCOMPLETE
3 years ago
5 months ago

People

(Reporter: mconley, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
Dependency tree / graph

Firefox Tracking Flags

(e10s+)

Details

https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/lib/sdk/core/namespace.js#l34


function ns() {
  const map = new WeakMap();
  return function namespace(target) {
    if (!target)        // If `target` is not an object return `target` itself.
      return target;
    // If target has no namespaced object yet, create one that inherits from
    // the target prototype's namespaced object.
    if (!map.has(target))
      map.set(target, create(namespace(prototypeOf(target) || null))); <-- causes unsafe CPOW usage warning

    return map.get(target);
  };
};
Blocks: 1004745
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #0)
> https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/lib/
> sdk/core/namespace.js#l34
> 
> 
> function ns() {
>   const map = new WeakMap();
>   return function namespace(target) {
>     if (!target)        // If `target` is not an object return `target`
> itself.
>       return target;
>     // If target has no namespaced object yet, create one that inherits from
>     // the target prototype's namespaced object.
>     if (!map.has(target))
>       map.set(target, create(namespace(prototypeOf(target) || null))); <--
> causes unsafe CPOW usage warning
> 
>     return map.get(target);
>   };
> };

This must only be an issue if `target` is a CPOW, so this doesn't provide much info.

Updated

2 years ago
Priority: P1 → --
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.