@@ -908,7 +908,6 @@ class Lexer {
908908
909909 getNumber ( ) {
910910 let ch = this . currentChar ;
911- let eNotation = false ;
912911 let divideBy = 0 ; // Different from 0 if it's a floating point value.
913912 let sign = 1 ;
914913
@@ -951,22 +950,15 @@ class Lexer {
951950 }
952951
953952 let baseValue = ch - 0x30 ; // '0'
954- let powerValue = 0 ;
955- let powerValueSign = 1 ;
956953
957954 while ( ( ch = this . nextChar ( ) ) >= 0 ) {
958955 if ( ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39 ) {
959956 const currentDigit = ch - 0x30 ; // '0'
960- if ( eNotation ) {
961- // We are after an 'e' or 'E'.
962- powerValue = powerValue * 10 + currentDigit ;
963- } else {
964- if ( divideBy !== 0 ) {
965- // We are after a point.
966- divideBy *= 10 ;
967- }
968- baseValue = baseValue * 10 + currentDigit ;
957+ if ( divideBy !== 0 ) {
958+ // We are after a point.
959+ divideBy *= 10 ;
969960 }
961+ baseValue = baseValue * 10 + currentDigit ;
970962 } else if ( ch === /* '.' = */ 0x2e ) {
971963 if ( divideBy === 0 ) {
972964 divideBy = 1 ;
@@ -978,18 +970,6 @@ class Lexer {
978970 // Ignore minus signs in the middle of numbers to match
979971 // Adobe's behavior.
980972 warn ( "Badly formatted number: minus sign in the middle" ) ;
981- } else if ( ch === /* 'E' = */ 0x45 || ch === /* 'e' = */ 0x65 ) {
982- // 'E' can be either a scientific notation or the beginning of a new
983- // operator.
984- ch = this . peekChar ( ) ;
985- if ( ch === /* '+' = */ 0x2b || ch === /* '-' = */ 0x2d ) {
986- powerValueSign = ch === 0x2d ? - 1 : 1 ;
987- this . nextChar ( ) ; // Consume the sign character.
988- } else if ( ch < /* '0' = */ 0x30 || ch > /* '9' = */ 0x39 ) {
989- // The 'E' must be the beginning of a new operator.
990- break ;
991- }
992- eNotation = true ;
993973 } else {
994974 // The last character doesn't belong to us.
995975 break ;
@@ -999,9 +979,6 @@ class Lexer {
999979 if ( divideBy !== 0 ) {
1000980 baseValue /= divideBy ;
1001981 }
1002- if ( eNotation ) {
1003- baseValue *= 10 ** ( powerValueSign * powerValue ) ;
1004- }
1005982 return sign * baseValue ;
1006983 }
1007984
0 commit comments