summaryrefslogtreecommitdiff
path: root/src/js.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/js.rs')
-rw-r--r--src/js.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/js.rs b/src/js.rs
index d924969..c0a96f8 100644
--- a/src/js.rs
+++ b/src/js.rs
@@ -24,6 +24,7 @@ use boa_interner::Sym;
use ion_rs::SymbolTable;
+use crate::disasm::print_disassembly;
use crate::ion::IonValue;
use crate::runtime::Function;
use crate::runtime::OpCode;
@@ -460,12 +461,12 @@ impl JsCompiler {
},
Expression::Parenthesized(expr) => self.get_static_expression(expr.expression()),
-
+
// TODO: Add static evaluation to these.
- Expression::Assign(assignment) => None,
+ Expression::Assign(_) => None,
Expression::Unary(_) => None,
Expression::Update(_) => None,
- Expression::Binary(binary) => None,
+ Expression::Binary(_) => None,
Expression::BinaryInPrivate(_) => None,
Expression::Conditional(_) => None,
Expression::Call(_) => None,
@@ -572,7 +573,6 @@ impl JsCompiler {
},
PropertyAccessField::Expr(expr) => {
self.compile_expression(expr);
- todo!("cast to symbol")
},
}
let jump_found = self.push_ifeq2();
@@ -630,7 +630,7 @@ impl JsCompiler {
}
}
}
-
+
fn compile_statement(&mut self, statement: &Statement) {
match statement {
boa_ast::Statement::Block(block) => {
@@ -768,6 +768,11 @@ impl JsCompiler {
println!();
}
println!();
+
+ println!("Disassembly");
+ println!("--------");
+ print_disassembly(&self.bytecode);
+ println!();
}
pub fn compile_script(&mut self, script: Script) {