@@ -119,33 +119,33 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, X3DParser .protot
119
119
Vector2 : new Vector2 ( ) ,
120
120
Vector3 : new Vector3 ( ) ,
121
121
Vector4 : new Vector4 ( ) ,
122
- CONSTANTS : {
123
- NAN : Number . NaN ,
124
- INFINITY : Number . POSITIVE_INFINITY ,
125
- INF : Number . POSITIVE_INFINITY ,
126
- PI : Math . PI ,
127
- PI2 : Math . PI * 2 ,
128
- PI1_4 : Math . PI * 1 / 4 ,
129
- PI2_4 : Math . PI * 2 / 4 ,
130
- PI3_4 : Math . PI * 3 / 4 ,
131
- PI4_4 : Math . PI * 4 / 4 ,
132
- PI5_4 : Math . PI * 5 / 4 ,
133
- PI6_4 : Math . PI * 6 / 4 ,
134
- PI7_4 : Math . PI * 7 / 4 ,
135
- PI8_4 : Math . PI * 8 / 4 ,
136
- PI1_2 : Math . PI * 1 / 2 ,
137
- PI2_2 : Math . PI * 2 / 2 ,
138
- PI3_2 : Math . PI * 3 / 2 ,
139
- PI4_2 : Math . PI * 4 / 2 ,
140
- PI1_3 : Math . PI * 1 / 3 ,
141
- PI2_3 : Math . PI * 2 / 3 ,
142
- PI3_3 : Math . PI * 3 / 3 ,
143
- PI4_3 : Math . PI * 4 / 3 ,
144
- PI5_3 : Math . PI * 5 / 3 ,
145
- PI6_3 : Math . PI * 6 / 3 ,
146
- SQRT1_2 : Math . SQRT1_2 ,
147
- SQRT2 : Math . SQRT2 ,
148
- } ,
122
+ CONSTANTS : new Map ( [
123
+ [ " NAN" , Number . NaN ] ,
124
+ [ " INFINITY" , Number . POSITIVE_INFINITY ] ,
125
+ [ " INF" , Number . POSITIVE_INFINITY ] ,
126
+ [ "PI" , Math . PI ] ,
127
+ [ " PI2" , Math . PI * 2 ] ,
128
+ [ " PI1_4" , Math . PI * 1 / 4 ] ,
129
+ [ " PI2_4" , Math . PI * 2 / 4 ] ,
130
+ [ " PI3_4" , Math . PI * 3 / 4 ] ,
131
+ [ " PI4_4" , Math . PI * 4 / 4 ] ,
132
+ [ " PI5_4" , Math . PI * 5 / 4 ] ,
133
+ [ " PI6_4" , Math . PI * 6 / 4 ] ,
134
+ [ " PI7_4" , Math . PI * 7 / 4 ] ,
135
+ [ " PI8_4" , Math . PI * 8 / 4 ] ,
136
+ [ " PI1_2" , Math . PI * 1 / 2 ] ,
137
+ [ " PI2_2" , Math . PI * 2 / 2 ] ,
138
+ [ " PI3_2" , Math . PI * 3 / 2 ] ,
139
+ [ " PI4_2" , Math . PI * 4 / 2 ] ,
140
+ [ " PI1_3" , Math . PI * 1 / 3 ] ,
141
+ [ " PI2_3" , Math . PI * 2 / 3 ] ,
142
+ [ " PI3_3" , Math . PI * 3 / 3 ] ,
143
+ [ " PI4_3" , Math . PI * 4 / 3 ] ,
144
+ [ " PI5_3" , Math . PI * 5 / 3 ] ,
145
+ [ " PI6_3" , Math . PI * 6 / 3 ] ,
146
+ [ " SQRT1_2" , Math . SQRT1_2 ] ,
147
+ [ " SQRT2" , Math . SQRT2 ] ,
148
+ ] ) ,
149
149
unknownLevel : 0 ,
150
150
getEncoding ( )
151
151
{
@@ -1556,7 +1556,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, X3DParser .protot
1556
1556
1557
1557
if ( Grammar . CONSTANTS . parse ( this ) )
1558
1558
{
1559
- this . value = this . CONSTANTS [ this . result [ 2 ] . toUpperCase ( ) ] ;
1559
+ this . value = this . CONSTANTS . get ( this . result [ 2 ] . toUpperCase ( ) ) ;
1560
1560
1561
1561
if ( this . result [ 1 ] === "-" )
1562
1562
this . value = - this . value ;
0 commit comments