| @@ -592,14 +592,15 @@ struct JavascriptEngine::RootObject : public DynamicObject | |||||
| struct DivideOp : public BinaryOperator | struct DivideOp : public BinaryOperator | ||||
| { | { | ||||
| DivideOp (const CodeLocation& l, ExpPtr& a, ExpPtr& b) noexcept : BinaryOperator (l, a, b, TokenTypes::divide) {} | DivideOp (const CodeLocation& l, ExpPtr& a, ExpPtr& b) noexcept : BinaryOperator (l, a, b, TokenTypes::divide) {} | ||||
| var getWithDoubles (double a, double b) const override { return b != 0.0 ? a / b : std::numeric_limits<double>::infinity(); } | |||||
| var getWithInts (int64 a, int64 b) const override { return b != 0 ? var (a / (double) b) : var (std::numeric_limits<double>::infinity()); } | |||||
| var getWithDoubles (double a, double b) const override { return b != 0 ? a / b : std::numeric_limits<double>::infinity(); } | |||||
| var getWithInts (int64 a, int64 b) const override { return b != 0 ? var (a / (double) b) : var (std::numeric_limits<double>::infinity()); } | |||||
| }; | }; | ||||
| struct ModuloOp : public BinaryOperator | struct ModuloOp : public BinaryOperator | ||||
| { | { | ||||
| ModuloOp (const CodeLocation& l, ExpPtr& a, ExpPtr& b) noexcept : BinaryOperator (l, a, b, TokenTypes::modulo) {} | ModuloOp (const CodeLocation& l, ExpPtr& a, ExpPtr& b) noexcept : BinaryOperator (l, a, b, TokenTypes::modulo) {} | ||||
| var getWithInts (int64 a, int64 b) const override { return b != 0 ? var (a % b) : var (std::numeric_limits<double>::infinity()); } | |||||
| var getWithDoubles (double a, double b) const override { return b != 0 ? fmod (a, b) : std::numeric_limits<double>::infinity(); } | |||||
| var getWithInts (int64 a, int64 b) const override { return b != 0 ? var (a % b) : var (std::numeric_limits<double>::infinity()); } | |||||
| }; | }; | ||||
| struct BitwiseOrOp : public BinaryOperator | struct BitwiseOrOp : public BinaryOperator | ||||