mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 05:33:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			864 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			864 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (C) 2019 Leo Balter. All rights reserved.
 | 
						|
// This code is governed by the BSD license found in the LICENSE file.
 | 
						|
 | 
						|
/*---
 | 
						|
esid: prod-NumericLiteralSeparator
 | 
						|
description: >
 | 
						|
  `0b` | `0B` BinaryDigits NumericLiteralSeparator BinaryDigit
 | 
						|
info: |
 | 
						|
  NumericLiteral ::
 | 
						|
    DecimalIntegerLiteral BigIntLiteralSuffix
 | 
						|
    NumericLiteralBase BigIntLiteralSuffix
 | 
						|
 | 
						|
  NumericLiteralBase ::
 | 
						|
    BinaryIntegerLiteral
 | 
						|
    OctalIntegerLiteral
 | 
						|
    HexIntegerLiteral
 | 
						|
 | 
						|
  BigIntLiteralSuffix :: n
 | 
						|
 | 
						|
  NumericLiteralSeparator ::
 | 
						|
    _
 | 
						|
 | 
						|
  BinaryIntegerLiteral ::
 | 
						|
    0b BinaryDigits
 | 
						|
    0B BinaryDigits
 | 
						|
 | 
						|
  BinaryDigits ::
 | 
						|
    BinaryDigit
 | 
						|
    BinaryDigits BinaryDigit
 | 
						|
    BinaryDigits NumericLiteralSeparator BinaryDigit
 | 
						|
 | 
						|
  BinaryDigit :: one of
 | 
						|
    0 1
 | 
						|
 | 
						|
features: [BigInt, numeric-separator-literal]
 | 
						|
---*/
 | 
						|
 | 
						|
assert.sameValue(0b01_0n, 0b010n);
 | 
						|
assert.sameValue(0B01_0n, 0B010n);
 |