mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-03 21:24:30 +01:00 
			
		
		
		
	Avoid extending builtin prototype and consistently define a shadowing property on the object instance to help recognize a possible implementation bug.
		
			
				
	
	
		
			20 lines
		
	
	
		
			422 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			422 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (C) 2015 the V8 project authors. All rights reserved.
 | 
						|
// This code is governed by the BSD license found in the LICENSE file.
 | 
						|
 | 
						|
/*---
 | 
						|
description: >
 | 
						|
    The HomeObject of Functions declared as methods is the Object prototype.
 | 
						|
es6id: 14.3.8
 | 
						|
features: [super]
 | 
						|
---*/
 | 
						|
 | 
						|
var obj = {
 | 
						|
  method(x = super.toString) {
 | 
						|
    return x;
 | 
						|
  }
 | 
						|
};
 | 
						|
 | 
						|
obj.toString = null;
 | 
						|
 | 
						|
assert.sameValue(obj.method(), Object.prototype.toString);
 |