File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,14 @@ function canUserAddDot(button) {
7070 if ( data [ i ] === "." ) {
7171 dotAllowed = false ;
7272 break ;
73- } else if ( / [ \/ * \- + ] / . test ( data [ i ] ) ) {
73+ } else if ( operatorRegex . test ( data [ i ] ) ) {
7474 break ;
7575 }
7676 }
7777 if ( dotAllowed ) {
7878 if ( data . length == 0 ) {
7979 data . push ( "0" ) ;
80- } else if ( / [ \/ * \- + ] / . test ( data [ data . length - 1 ] ) ) {
80+ } else if ( operatorRegex . test ( data [ data . length - 1 ] ) ) {
8181 data . push ( "0" ) ;
8282 }
8383 data . push ( "." ) ;
@@ -130,7 +130,7 @@ function insertOpeningParenthesis(button) {
130130 isOpenparenthesis = false ;
131131 break ;
132132 }
133- if ( / [ \/ * \- + ] / . test ( data [ i ] ) ) {
133+ if ( operatorRegex . test ( data [ i ] ) ) {
134134 break ;
135135 }
136136 }
@@ -155,7 +155,7 @@ function handlingZeroFollowedByAdecimal(button) {
155155}
156156
157157function removesDecimalPointIfPrecededByAnOperator ( button ) {
158- if ( / [ \/ * \- + ] / . test ( button ) ) {
158+ if ( operatorRegex . test ( button ) ) {
159159 if ( data . slice ( - 1 ) [ 0 ] === "." ) {
160160 data . pop ( ) ;
161161 }
You can’t perform that action at this time.
0 commit comments