opal/corelib/kernel/format.rb in opal-1.2.0 vs opal/corelib/kernel/format.rb in opal-1.3.0.alpha1

- old
+ new

@@ -64,12 +64,12 @@ return args[num]; } function GET_NEXT_ARG() { switch (pos_arg_num) { - case -1: #{raise ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with numbered"} - case -2: #{raise ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with named"} + case -1: #{raise ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with numbered"} // raise + case -2: #{raise ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with named"} // raise } pos_arg_num = seq_arg_num++; return GET_NTH_ARG(pos_arg_num - 1); } @@ -133,10 +133,11 @@ i++; switch (format_string.charAt(i)) { case '%': begin_slice = i; + // no-break case '': case '\n': case '\0': i++; continue; @@ -238,10 +239,11 @@ break format_sequence; } } hash_parameter_key += format_string.charAt(i); } + // raise case '*': i++; CHECK_FOR_WIDTH(); flags |= FWIDTH; @@ -480,9 +482,10 @@ case 'a': case 'A': // Not implemented because there are no specs for this field type. #{raise NotImplementedError, '`A` and `a` format field types are not implemented in Opal yet'} + // raise case 'c': arg = GET_ARG(); if (#{`arg`.respond_to?(:to_ary)}) { arg = #{`arg`.to_ary}[0]; } if (#{`arg`.respond_to?(:to_str)}) {