mirror of https://github.com/tc39/test262.git
test: private method usage: calling private method
This commit is contained in:
parent
ecb5fcbe33
commit
a6f2446e19
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: PrivateName CallExpression usage (private field)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
CallExpression[Yield, Await]:
|
||||
CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
|
||||
SuperCall[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
|
||||
CallExpression[?Yield, ?Await].IdentifierName
|
||||
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await].PrivateName
|
||||
|
||||
template: syntax/valid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#m = 1;
|
||||
method() {
|
||||
assert.sameValue(this.#m, 1);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: PrivateName CallExpression usage (Accesor get method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
CallExpression[Yield, Await]:
|
||||
CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
|
||||
SuperCall[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
|
||||
CallExpression[?Yield, ?Await].IdentifierName
|
||||
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await].PrivateName
|
||||
|
||||
template: syntax/valid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
get #m() { return 1; }
|
||||
method() {
|
||||
assert.sameValue(this.#m, 1);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: PrivateName CallExpression usage (private method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
CallExpression[Yield, Await]:
|
||||
CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
|
||||
SuperCall[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
|
||||
CallExpression[?Yield, ?Await].IdentifierName
|
||||
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
|
||||
CallExpression[?Yield, ?Await].PrivateName
|
||||
|
||||
template: syntax/valid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#m() { return 1; }
|
||||
method() {
|
||||
assert.sameValue(this.#m(), 1);
|
||||
}
|
Loading…
Reference in New Issue