archives

« Bugzilla Issues Index

#2413 — Required "new" to create DataView()


According to Sep2013 draft change notes (http://esdiscuss.org/topic/a-new-es6-draft-is-available) “new” is required to create DataView(). However the spec appears to still say (https://people.mozilla.org/~jorendorff/es6-draft.html#sec-dataview-constructor) DataView can be called without “new”.

Is this change still not added to spec ? Probably ArrayBuffer and other TypedArray types also should be inline with DataView.


(In reply to comment #0)

>
> Is this change still not added to spec ? Probably ArrayBuffer and other
> TypedArray types also should be inline with DataView.

See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-dataview-buffer-byteoffset-bytelength step 2.

A call like DataView(buff) will have undefined as its this value which throws in step 2.