mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 03:34:08 +01:00 
			
		
		
		
	sourceRevisionAtLastExport: 33f2fb0e53d135f0ee17cfccd9d993eb2a6f47de targetRevisionAtLastExport: 31340cbd9add103f586d501b0c3354b7b182abc0
		
			
				
	
	
		
			21 lines
		
	
	
		
			622 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			622 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright 2017 the V8 project authors. All rights reserved.
 | |
| // Use of this source code is governed by a BSD-style license that can be
 | |
| // found in the LICENSE file.
 | |
| 
 | |
| var ab = new Int8Array(20).map((v, i) => i).buffer;
 | |
| var ta = new Int8Array(ab, 0, 10);
 | |
| var seen_length = -1;
 | |
| ta.constructor = {
 | |
|   [Symbol.species]: function(len) {
 | |
|     seen_length = len;
 | |
|     return new Int8Array(ab, 1, len);
 | |
|   }
 | |
| };
 | |
| 
 | |
| assertEquals(-1, seen_length);
 | |
| assertArrayEquals([0,1,2,3,4,5,6,7,8,9], ta);
 | |
| var tb = ta.slice();
 | |
| assertEquals(10, seen_length);
 | |
| assertArrayEquals([0,0,0,0,0,0,0,0,0,0], ta);
 | |
| assertArrayEquals([0,0,0,0,0,0,0,0,0,0], tb);
 |