Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // Flags: --experimental-classes --harmony-classes | |
| 6 | |
| 7 'use strict'; | |
| 8 | |
| 9 class Base { | |
| 10 constructor() { | |
| 11 let o = new Object(); | |
| 12 o.prp = 1; | |
| 13 return o; | |
| 14 } | |
| 15 } | |
| 16 | |
| 17 class Subclass extends Base { | |
| 18 constructor() { | |
| 19 try { | |
| 20 this.prp1 = 3; | |
| 21 } catch(ReferenceError) {} | |
|
arv (Not doing code reviews)
2015/01/21 19:18:56
This does not do what you think it does.
Change i
Dmitry Lomov (no reviews)
2015/01/22 11:59:00
Right! Changed code, added a TODO to actually test
| |
| 22 super(); | |
| 23 assertSame(1, this.prp); | |
| 24 assertSame(undefined, this.prp1); | |
| 25 assertFalse(this.hasOwnProperty("prp1")); | |
| 26 return this; | |
| 27 } | |
| 28 } | |
| 29 | |
| 30 let s = new Subclass(); | |
| 31 assertSame(1, s.prp); | |
| 32 assertSame(undefined, s.prp1); | |
| 33 assertFalse(s.hasOwnProperty("prp1")); | |
| OLD | NEW |