[Bug 28244] New: Requiring @@toStringTag on instances may have performance implications

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244

            Bug ID: 28244
           Summary: Requiring @@toStringTag on instances may have
                    performance implications
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebIDL
          Assignee: cam@mcc.id.au
          Reporter: jsbell@google.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-script-coord@w3.org

The shiny new ECMAScript binding definition of class strings calls for a
@@toStringTag own property on each object instance implementing an interface,
and another own property on the prototype object. This may have
memory/performance implications since each object now has just a bit more data.

Over in https://code.google.com/p/chromium/issues/detail?id=239915 there's a
suggestion relayed from AWB to put the logic in a getter on the prototype, e.g.

Object.defineProperty(HTMLDivElement.prototype, Symbol.toStringTag, {
  get: function() {
    if (this === HTMLDivElement.prototype) {
      return 'HTMLDivElementPrototype';
    }
    return 'HTMLDivElement';
  },
  configurable: ???,
  writable: ???
});

Thoughts on revising WebIDL's definition here, before implementations bake
anything in?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 19 March 2015 17:41:06 UTC