@@ -186,16 +186,10 @@ void MCAdd::exec_ctxt(MCExecContext &ctxt)
186186#endif /* MCAdd */
187187
188188 MCExecValue t_src;
189- Boolean t_old_expectation;
190-
191- // SN-2014-04-08 [[ NumberExpectation ]] Ensure we get a number when it's possible instead of a ValueRef
192- t_old_expectation = ctxt . GetNumberExpected ();
193- ctxt . SetNumberExpected (True);
194-
189+
195190 if (!ctxt . EvaluateExpression (source, EE_ADD_BADSOURCE , t_src)
196191 || !ctxt . ConvertToNumberOrArray (t_src))
197192 {
198- ctxt . SetNumberExpected (t_old_expectation);
199193 return ;
200194 }
201195
@@ -217,7 +211,6 @@ void MCAdd::exec_ctxt(MCExecContext &ctxt)
217211 {
218212 ctxt . LegacyThrow (EE_ADD_BADDEST );
219213 MCExecTypeRelease (t_src);
220- ctxt . SetNumberExpected (t_old_expectation);
221214 return ;
222215 }
223216
@@ -227,13 +220,9 @@ void MCAdd::exec_ctxt(MCExecContext &ctxt)
227220 if (!ctxt . EvaluateExpression (dest, EE_ADD_BADDEST , t_dst))
228221 {
229222 MCExecTypeRelease (t_src);
230- ctxt . SetNumberExpected (t_old_expectation);
231223 return ;
232224 }
233- }
234-
235- // Set the number expectation back to its previous state
236- ctxt . SetNumberExpected (t_old_expectation);
225+ }
237226
238227 if (!ctxt . ConvertToNumberOrArray (t_dst))
239228 {
@@ -453,16 +442,10 @@ void MCDivide::exec_ctxt(MCExecContext &ctxt)
453442#endif /* MCDivide */
454443
455444 MCExecValue t_src;
456- Boolean t_old_expectation;
457-
458- // SN-2014-04-08 [[ NumberExpectation ]] Ensure we get a number when it's possible instead of a ValueRef
459- t_old_expectation = ctxt . GetNumberExpected ();
460- ctxt . SetNumberExpected (True);
461445
462446 if (!ctxt . EvaluateExpression (source, EE_DIVIDE_BADSOURCE , t_src)
463447 || !ctxt . ConvertToNumberOrArray (t_src))
464448 {
465- ctxt . SetNumberExpected (t_old_expectation);
466449 return ;
467450 }
468451
@@ -484,7 +467,6 @@ void MCDivide::exec_ctxt(MCExecContext &ctxt)
484467 {
485468 ctxt . LegacyThrow (EE_DIVIDE_BADDEST );
486469 MCExecTypeRelease (t_src);
487- ctxt . SetNumberExpected (t_old_expectation);
488470 return ;
489471 }
490472 }
@@ -493,13 +475,9 @@ void MCDivide::exec_ctxt(MCExecContext &ctxt)
493475 if (!ctxt . EvaluateExpression (dest, EE_DIVIDE_BADDEST , t_dst))
494476 {
495477 MCExecTypeRelease (t_src);
496- ctxt . SetNumberExpected (t_old_expectation);
497478 return ;
498479 }
499480 }
500-
501- // Set the number expectation back to its previous state
502- ctxt . SetNumberExpected (t_old_expectation);
503481
504482 if (!ctxt . ConvertToNumberOrArray (t_dst))
505483 {
@@ -718,16 +696,10 @@ void MCMultiply::exec_ctxt(MCExecContext &ctxt)
718696#endif /* MCMultiply */
719697
720698 MCExecValue t_src;
721- Boolean t_old_expectation;
722-
723- // SN-2014-04-08 [[ NumberExpectation ]] Ensure we get a number when it's possible instead of a ValueRef
724- t_old_expectation = ctxt . GetNumberExpected ();
725- ctxt . SetNumberExpected (True);
726699
727700 if (!ctxt . EvaluateExpression (source, EE_MULTIPLY_BADSOURCE , t_src)
728701 || !ctxt . ConvertToNumberOrArray (t_src))
729702 {
730- ctxt . SetNumberExpected (t_old_expectation);
731703 return ;
732704 }
733705
@@ -749,7 +721,6 @@ void MCMultiply::exec_ctxt(MCExecContext &ctxt)
749721 {
750722 ctxt . LegacyThrow (EE_MULTIPLY_BADDEST );
751723 MCExecTypeRelease (t_src);
752- ctxt . SetNumberExpected (t_old_expectation);
753724 return ;
754725 }
755726 }
@@ -758,13 +729,9 @@ void MCMultiply::exec_ctxt(MCExecContext &ctxt)
758729 if (!ctxt . EvaluateExpression (dest, EE_MULTIPLY_BADDEST , t_dst))
759730 {
760731 MCExecTypeRelease (t_src);
761- ctxt . SetNumberExpected (t_old_expectation);
762732 return ;
763733 }
764734 }
765-
766- // Set the number expectation back to the previous state
767- ctxt . SetNumberExpected (t_old_expectation);
768735
769736 if (!ctxt . ConvertToNumberOrArray (t_dst))
770737 {
@@ -966,16 +933,10 @@ void MCSubtract::exec_ctxt(MCExecContext &ctxt)
966933#endif /* MCSubtract */
967934
968935 MCExecValue t_src;
969- Boolean t_old_expectation;
970-
971- // SN-2014-04-08 [[ NumberExpectation ]] Ensure we get a number when it's possible instead of a ValueRef
972- t_old_expectation = ctxt . GetNumberExpected ();
973- ctxt . SetNumberExpected (True);
974936
975937 if (!ctxt . EvaluateExpression (source, EE_SUBTRACT_BADSOURCE , t_src)
976938 || !ctxt . ConvertToNumberOrArray (t_src))
977939 {
978- ctxt . SetNumberExpected (t_old_expectation);
979940 return ;
980941 }
981942
@@ -997,7 +958,6 @@ void MCSubtract::exec_ctxt(MCExecContext &ctxt)
997958 {
998959 ctxt . LegacyThrow (EE_SUBTRACT_BADDEST );
999960 MCExecTypeRelease (t_src);
1000- ctxt . SetNumberExpected (t_old_expectation);
1001961 return ;
1002962 }
1003963 }
@@ -1006,13 +966,9 @@ void MCSubtract::exec_ctxt(MCExecContext &ctxt)
1006966 if (!ctxt . EvaluateExpression (dest, EE_SUBTRACT_BADDEST , t_dst))
1007967 {
1008968 MCExecTypeRelease (t_src);
1009- ctxt . SetNumberExpected (t_old_expectation);
1010969 return ;
1011970 }
1012971 }
1013-
1014- // Set the number expectation back to its previous state
1015- ctxt . SetNumberExpected (t_old_expectation);
1016972
1017973 if (!ctxt . ConvertToNumberOrArray (t_dst))
1018974 {
0 commit comments