mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-03 21:24:30 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// This file was procedurally generated from the following sources:
 | 
						|
// - src/class-elements/private-method-usage.case
 | 
						|
// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
 | 
						|
/*---
 | 
						|
description: PrivateName CallExpression usage (private method) (multiple stacked fields definitions through ASI)
 | 
						|
esid: prod-FieldDefinition
 | 
						|
features: [class-methods-private, class, class-fields-public]
 | 
						|
flags: [generated]
 | 
						|
includes: [propertyHelper.js]
 | 
						|
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
 | 
						|
 | 
						|
---*/
 | 
						|
 | 
						|
 | 
						|
var C = class {
 | 
						|
  #m() { return 'test262'; }
 | 
						|
  foo = "foobar"
 | 
						|
  bar = "barbaz";
 | 
						|
  method() {
 | 
						|
    return this.#m();
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
var c = new C();
 | 
						|
 | 
						|
assert.sameValue(c.foo, "foobar");
 | 
						|
assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
 | 
						|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
 | 
						|
 | 
						|
verifyProperty(c, "foo", {
 | 
						|
  value: "foobar",
 | 
						|
  enumerable: true,
 | 
						|
  configurable: true,
 | 
						|
  writable: true,
 | 
						|
});
 | 
						|
 | 
						|
assert.sameValue(c.bar, "barbaz");
 | 
						|
assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
 | 
						|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
 | 
						|
 | 
						|
verifyProperty(c, "bar", {
 | 
						|
  value: "barbaz",
 | 
						|
  enumerable: true,
 | 
						|
  configurable: true,
 | 
						|
  writable: true,
 | 
						|
});
 | 
						|
 | 
						|
assert.sameValue(c.method(), 'test262');
 |