| 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: --harmony-computed-property-names --harmony-object-literals | 
 |   6 // Flags: --harmony-classes --allow-natives-syntax | 
 |   7  | 
 |   8  | 
 |   9 function ID(x) { | 
 |  10   return x; | 
 |  11 } | 
 |  12  | 
 |  13  | 
 |  14 (function TestComputedMethodSuper() { | 
 |  15   var proto = { | 
 |  16     m() { | 
 |  17       return ' proto m'; | 
 |  18     } | 
 |  19   }; | 
 |  20   var object = { | 
 |  21     __proto__: proto, | 
 |  22     ['a']() { return 'a' + super.m(); }, | 
 |  23     [ID('b')]() { return 'b' + super.m(); }, | 
 |  24     [0]() { return '0' + super.m(); }, | 
 |  25     [ID(1)]() { return '1' + super.m(); }, | 
 |  26   }; | 
 |  27  | 
 |  28   assertSame(object, object.a[%HomeObjectSymbol()]); | 
 |  29  | 
 |  30   assertEquals('a proto m', object.a()); | 
 |  31   assertEquals('b proto m', object.b()); | 
 |  32   assertEquals('0 proto m', object[0]()); | 
 |  33   assertEquals('1 proto m', object[1]()); | 
 |  34 })(); | 
 |  35  | 
 |  36  | 
 |  37 (function TestComputedGetterSuper() { | 
 |  38   var proto = { | 
 |  39     m() { | 
 |  40       return ' proto m'; | 
 |  41     } | 
 |  42   }; | 
 |  43   var object = { | 
 |  44     __proto__: proto, | 
 |  45     get ['a']() { return 'a' + super.m(); }, | 
 |  46     get [ID('b')]() { return 'b' + super.m(); }, | 
 |  47     get [0]() { return '0' + super.m(); }, | 
 |  48     get [ID(1)]() { return '1' + super.m(); }, | 
 |  49   }; | 
 |  50   assertEquals('a proto m', object.a); | 
 |  51   assertEquals('b proto m', object.b); | 
 |  52   assertEquals('0 proto m', object[0]); | 
 |  53   assertEquals('1 proto m', object[1]); | 
 |  54 })(); | 
 |  55  | 
 |  56  | 
 |  57 (function TestComputedSetterSuper() { | 
 |  58   var value; | 
 |  59   var proto = { | 
 |  60     m(name, v) { | 
 |  61       value = name + ' ' + v; | 
 |  62     } | 
 |  63   }; | 
 |  64   var object = { | 
 |  65     __proto__: proto, | 
 |  66     set ['a'](v) { super.m('a', v); }, | 
 |  67     set [ID('b')](v) { super.m('b', v); }, | 
 |  68     set [0](v) { super.m('0', v); }, | 
 |  69     set [ID(1)](v) { super.m('1', v); }, | 
 |  70   }; | 
 |  71   object.a = 2; | 
 |  72   assertEquals('a 2', value); | 
 |  73   object.b = 3; | 
 |  74   assertEquals('b 3', value); | 
 |  75   object[0] = 4; | 
 |  76   assertEquals('0 4', value); | 
 |  77   object[1] = 5; | 
 |  78   assertEquals('1 5', value); | 
 |  79 })(); | 
| OLD | NEW |