mirror of
https://github.com/tc39/test262.git
synced 2025-05-16 12:50:37 +02:00
Avoid extending builtin prototype and consistently define a shadowing property on the object instance to help recognize a possible implementation bug.
23 lines
473 B
JavaScript
23 lines
473 B
JavaScript
// Copyright 2015 Cubane Canada, Inc. All rights reserved.
|
|
// See LICENSE for details.
|
|
|
|
/*---
|
|
info: >
|
|
GeneratorMethod can reference SuperProperty in arg
|
|
features: [generators]
|
|
es6id: 14.4.1
|
|
author: Sam Mikes
|
|
description: GeneratorMethod uses SuperProperty (allowed)
|
|
features: [ default-arg, generator, super ]
|
|
---*/
|
|
|
|
var obj = {
|
|
*foo(a = super.toString) {
|
|
return a;
|
|
}
|
|
};
|
|
|
|
obj.toString = null;
|
|
|
|
assert.sameValue(obj.foo().next().value, Object.prototype.toString);
|