Le 15/01/2012 21:23, David Bruant a écrit :
> -----
> function C(){
>     this.length = 3;
> }
>
> function f(a,b){}
>
> C.prototype = f;
>
> var c = new C();
> console.log(c.length);
> -----
> For this code, ECMAScript 5 says:
> When doing "new C()", |this| is assigned "C.prototype" which is the
> function f (it has a non-writable, non-configurable "length" property
> with 2 as value).
> During "this.length = 3;", [[CanPut]] should return
> "inherited.[[Writable]]" (step 8.b). In this case, it should return false.
>
> Firefox 9, 11 (Aurora) (...) log 3 (non-compliant)
Apparently, Firefox logs 2, my mistake.

David
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to