computed-property-names: corrections. Fixes gh-198

This commit is contained in:
Rick Waldron 2015-03-18 18:50:05 -04:00
parent 538a2a8e83
commit fc3e2cab05
9 changed files with 35 additions and 32 deletions

View File

@ -3,7 +3,7 @@
/*---
es6id: 14.5.3
description: >
computed property getter names cannot be "constructor"
computed property getter names can be called "constructor"
negative: SyntaxError
---*/
class C4 {

View File

@ -3,7 +3,7 @@
/*---
es6id: 14.5.3
description: >
computed property setter names cannot be "constructor"
computed property setter names can be called "constructor"
negative: SyntaxError
---*/
class C4 {

View File

@ -3,8 +3,7 @@
/*---
es6id: 12.2.5
description: >
computed property names can be "constructor", but duplicates are not allowed, 1
negative: SyntaxError
computed property names can be "constructor"
---*/
class C {
constructor() {}

View File

@ -3,8 +3,7 @@
/*---
es6id: 12.2.5
description: >
computed property names can be "constructor", but duplicates are not allowed, 2
negative: SyntaxError
computed property names can be "constructor"
---*/
class C {
['constructor']() {}

View File

@ -3,8 +3,7 @@
/*---
es6id: 12.2.5
description: >
computed property names can be "constructor", but duplicates are not allowed, 2
negative: SyntaxError
computed property names can be "constructor"
---*/
class C {
['constructor']() {}

View File

@ -1,12 +1,13 @@
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 12.2.5
es6id: 14.5.14
description: >
In a class, computed property names for static
generators cannot be "prototype"
negative: SyntaxError
generators that are named "prototype" throw a TypeError
---*/
class C {
static *['prototype']() {}
}
assert.throws(TypeError, function() {
class C {
static *['prototype']() {}
}
});

View File

@ -1,12 +1,13 @@
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 12.2.5
es6id: 14.5.14
description: >
In a class, computed property names for static
getters cannot be "prototype"
negative: SyntaxError
getters that are named "prototype" throw a TypeError
---*/
class C {
static get ['prototype']() {}
}
assert.throws(TypeError, function() {
class C {
static get ['prototype']() {}
}
});

View File

@ -1,12 +1,14 @@
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 12.2.5
es6id: 14.5.14
description: >
In a class, computed property names for static
methods cannot be "prototype"
negative: SyntaxError
methods that are named "prototype" throw a TypeError
---*/
class C {
static ['prototype']() {}
}
assert.throws(TypeError, function() {
class C {
static ['prototype']() {}
}
});

View File

@ -1,12 +1,14 @@
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 12.2.5
es6id: 14.5.14
description: >
In a class, computed property names for static
setters cannot be "prototype"
negative: SyntaxError
setters that are named "prototype" throw a TypeError
---*/
class C {
static set ['prototype'](x) {}
}
assert.throws(TypeError, function() {
class C {
static set ['prototype'](x) {}
}
});