mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 05:33:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			688 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			688 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright 2015 Microsoft Corporation. All rights reserved.
 | 
						|
// This code is governed by the license found in the LICENSE file.
 | 
						|
 | 
						|
/*---
 | 
						|
description: Passing a valid array
 | 
						|
esid: sec-array.from
 | 
						|
es6id: 22.1.2.1
 | 
						|
---*/
 | 
						|
 | 
						|
var array = [0, 'foo', , Infinity];
 | 
						|
var result = Array.from(array);
 | 
						|
 | 
						|
assert.sameValue(result.length, 4, 'result.length');
 | 
						|
assert.sameValue(result[0], 0, 'result[0]');
 | 
						|
assert.sameValue(result[1], 'foo', 'result[1]');
 | 
						|
assert.sameValue(result[2], undefined, 'result[2]');
 | 
						|
assert.sameValue(result[3], Infinity, 'result[3]');
 | 
						|
 | 
						|
assert.notSameValue(
 | 
						|
  result, array,
 | 
						|
  'result is not the object from items argument'
 | 
						|
);
 | 
						|
 | 
						|
assert(result instanceof Array, 'result instanceof Array');
 |