File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/com/shapesecurity/shift/es2017/parser Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ public String collect(@Nonnull String[]... stringArrays) {
163163 public String collect (Maybe <Integer > limit , @ Nonnull String []... stringArrays ) {
164164 StringBuilder stringBuilder = new StringBuilder ();
165165 boolean isJust = limit .isJust ();
166- int justLimit = limit .fromJust ( );
166+ int justLimit = limit .orJust ( 0 );
167167 outer :
168168 for (int i = 0 ; !isJust || justLimit > i ; ++i ) {
169169 for (String [] strings : stringArrays ) {
@@ -436,7 +436,6 @@ private boolean acceptDecimalEscapeBackreference(State superState) {
436436 @ Nonnull
437437 private Maybe <Integer > acceptDecimalEscape (State superState ) {
438438 return superState .backtrackOnFailureMaybe (state -> {
439- StringBuilder digits = new StringBuilder ();
440439 Maybe <String > firstDigit = state .eatAny (decimalDigits );
441440 if (firstDigit .isNothing ()) {
442441 return Maybe .empty ();
@@ -447,6 +446,7 @@ private Maybe<Integer> acceptDecimalEscape(State superState) {
447446 if (this .unicode ) {
448447 return Maybe .empty ();
449448 }
449+ StringBuilder digits = new StringBuilder ();
450450 digits .append (firstDigit .fromJust ());
451451 Maybe <String > digit = state .eatAny (decimalDigits );
452452 if (digit .isJust ()) {
You can’t perform that action at this time.
0 commit comments