mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 11:44:31 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			656 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			656 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright (C) 2022 Igalia, S.L. All rights reserved.
 | |
| // This code is governed by the BSD license found in the LICENSE file.
 | |
| 
 | |
| /*---
 | |
| esid: sec-temporal.plaindatetime.from
 | |
| description: Possibly throw if overflow is reject
 | |
| features: [Temporal]
 | |
| includes: [temporalHelpers.js]
 | |
| ---*/
 | |
| 
 | |
| TemporalHelpers.assertPlainDateTime(
 | |
|   Temporal.PlainDateTime.from({year: 2019, month: 1, day: 31}, {overflow: "reject"}),
 | |
|   2019, 1, "M01", 31, 0, 0, 0, 0, 0, 0,
 | |
|   "overflow reject, acceptable argument"
 | |
| );
 | |
| 
 | |
| assert.throws(
 | |
|   RangeError,
 | |
|   () => Temporal.PlainDateTime.from({year: 2019, month: 1, day: 32}, {overflow: "reject"}),
 | |
|   "overflow reject, unacceptable argument"
 | |
| );
 |