[Bug 22947] Operation functions should not have a prototype property

# bugzilla at jessica.w3.org (4 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=22947

Boris Zbarsky bzbarsky@mit.edu changed:

       What    |Removed                     |Added

             CC|                            |bzbarsky@mit.edu

--- Comment #1 from Boris Zbarsky bzbarsky@mit.edu ---

WebIDL says nothing about these having a "prototype" own property, so they have nothing there in particular, which matches the implementations... Maybe I'm missing what this bug is about?

Contact us to advertise here
# bugzilla at jessica.w3.org (4 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=22947

--- Comment #2 from Erik Arvidsson arv@chromium.org ---

Functions have a prototype property by default. I would like the spec to point out that the functions backing operations are not normal functions and should not have a prototype (same for the getter and setter functions).

# Mark S. Miller (4 years ago)

I agree they should not have a prototype property or a [[Construct]] internal method. But I would avoid the phrase "not normal functions". In ES3 and ES5, all non-constructor Chapter 15 functions are of this form. In ES6, arrow functions are as well.

# bugzilla at jessica.w3.org (4 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=22947

Mark S. Miller erights@gmail.com changed:

       What    |Removed                     |Added

             CC|                            |erights@gmail.com

--- Comment #3 from Mark S. Miller erights@gmail.com --- (In reply to comment #2)

Functions have a prototype property by default. I would like the spec to point out that the functions backing operations are not normal functions and should not have a prototype (same for the getter and setter functions).

I agree they should not have a prototype property or a [[Construct]] internal method. But I would avoid the phrase "not normal functions". In ES3 and ES5, all non-constructor Chapter 15 functions are of this form. In ES6, arrow functions are as well.

# bugzilla at jessica.w3.org (4 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=22947

Domenic Denicola domenic@domenicdenicola.com changed:

       What    |Removed                     |Added

             CC|                            |domenic@domenicdenicola.com

--- Comment #4 from Domenic Denicola domenic@domenicdenicola.com ---

I believe ES6 methods do not have prototype properties or [[Construct]] internal methods, at least per the non-normative prose 1. Thus it would suffice to say that WebIDL methods should be created in the same way as ES6 methods.

# bugzilla at jessica.w3.org (7 months ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=22947

Domenic Denicola d@domenic.me changed:

       What    |Removed                     |Added

     Resolution|---                         |FIXED
         Status|NEW                         |RESOLVED

--- Comment #5 from Domenic Denicola d@domenic.me ---

Fixed by heycam/webidl/commit/a2b4599631fe0fa254a7a4993dd7f00b74c8ad20 with issue heycam/webidl#106

Want more features?

Request early access to our private beta of readable email premium.