This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22947 - Operation functions should not have a prototype property
Summary: Operation functions should not have a prototype property
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-13 23:03 UTC by Erik Arvidsson
Modified: 2016-10-22 16:06 UTC (History)
5 users (show)

See Also:


Attachments

Description Erik Arvidsson 2013-08-13 23:03:28 UTC
In Firefox, Safari and IE, the functions used for operations (ie document.appendChild) do not have a prototype property. This is analog with the JS builtins (like Date.prototype.getFullYear)
Comment 1 Boris Zbarsky 2013-08-19 06:11:36 UTC
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?
Comment 2 Erik Arvidsson 2013-08-20 14:21:09 UTC
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).
Comment 3 Mark S. Miller 2013-08-20 14:46:45 UTC
(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.
Comment 4 Domenic Denicola 2013-08-20 15:08:57 UTC
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.

[1]: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.4.2