mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 03:34:08 +01:00 
			
		
		
		
	* Add SuperProperty test * Add SuperCall test * Add ClassDeclaration test * Add ClassExpression test
		
			
				
	
	
		
			36 lines
		
	
	
		
			852 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			852 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright (C) 2019 Alexey Shvayka. All rights reserved.
 | |
| // This code is governed by the BSD license found in the LICENSE file.
 | |
| /*---
 | |
| esid: prod-SuperProperty
 | |
| description: >
 | |
|   SuperProperty should directly call [[GetPrototypeOf]] internal method.
 | |
| info: |
 | |
|   MakeSuperPropertyReference ( actualThis, propertyKey, strict )
 | |
| 
 | |
|   [...]
 | |
|   3. Let baseValue be ? env.GetSuperBase().
 | |
| 
 | |
|   GetSuperBase ( )
 | |
| 
 | |
|   [...]
 | |
|   5. Return ? home.[[GetPrototypeOf]]().
 | |
| ---*/
 | |
| 
 | |
| Object.defineProperty(Object.prototype, '__proto__', {
 | |
|   get: function() {
 | |
|     throw new Test262Error('should not be called');
 | |
|   },
 | |
| });
 | |
| 
 | |
| var obj = {
 | |
|   superExpression() {
 | |
|     return super['CONSTRUCTOR'.toLowerCase()];
 | |
|   },
 | |
|   superIdentifierName() {
 | |
|     return super.toString();
 | |
|   },
 | |
| };
 | |
| 
 | |
| assert.sameValue(obj.superExpression(), Object);
 | |
| assert.sameValue(obj.superIdentifierName(), '[object Object]');
 |