| 1 |
// Copyright (C) 2017 Valerie Young. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: ASI test in field declarations -- field with PropertyName "in" interpreted as index |
| 6 |
esid: sec-automatic-semicolon-insertion |
| 7 |
features: [class, class-fields-public] |
| 8 |
---*/ |
| 9 |
|
| 10 |
var x = 0; |
| 11 |
var y = 1; |
| 12 |
var z = [42]; |
| 13 |
|
| 14 |
var C = class { |
| 15 |
a = x |
| 16 |
in |
| 17 |
z |
| 18 |
b = y |
| 19 |
in |
| 20 |
z |
| 21 |
} |
| 22 |
|
| 23 |
var c = new C(); |
| 24 |
|
| 25 |
assert.sameValue(c.a, true, 'a = x in z'); |
| 26 |
assert.sameValue(c.b, false, 'b = y in z'); |
| 27 |
assert.sameValue(Object.hasOwnProperty.call(c, "in"), false, "'in'"); |
| 28 |
assert.sameValue(Object.hasOwnProperty.call(c, "z"), false, "'z'"); |