Comparing version 0.2.0 to 0.3.0
@@ -35,2 +35,4 @@ "use strict"; | ||
return left_node >> right_node; | ||
case '>>>': | ||
return left_node >>> right_node; | ||
case '>=': | ||
@@ -44,4 +46,9 @@ return left_node >= right_node; | ||
return left_node & right_node; | ||
// Rational operators | ||
case 'in': | ||
return left_node in right_node; | ||
case 'instanceof': | ||
return left_node instanceof right_node; | ||
default: | ||
console.warn('Unsupported operator: ', operator); | ||
console.warn('Unsupported binary operator: ', operator); | ||
} | ||
@@ -48,0 +55,0 @@ } |
import Visitor from '../visitor'; | ||
export default class UnaryExpression { | ||
static visit(node: any, visitor: Visitor): number | undefined; | ||
static visit(node: any, visitor: Visitor): number | "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | undefined; | ||
} |
@@ -15,4 +15,8 @@ "use strict"; | ||
} | ||
case 'typeof': { | ||
const arg = visitor.visitNode(node.argument); | ||
return typeof arg; | ||
} | ||
default: | ||
console.warn('Unsupported operator: ', operator); | ||
console.warn('Unsupported unary operator: ', operator); | ||
} | ||
@@ -19,0 +23,0 @@ } |
{ | ||
"name": "jintr", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A tiny JavaScript interpreter written in TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38056
980