Skip to content
Snippets Groups Projects
Commit a6f2446e authored by jbhoosreddy's avatar jbhoosreddy Committed by Rick Waldron
Browse files

test: private method usage: calling private method

parent ecb5fcbe
No related branches found
No related tags found
No related merge requests found
// 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);
}
// 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);
}
// 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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment