Implement JSOP_VOID. No bug, r=dvander
Implement JSOP_VOID. No bug, r=dvander
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -398,16 +398,20 @@ IonBuilder::inspectOpcode(JSOp op)
return pushConstant(Int32Value(0));
case JSOP_ONE:
return pushConstant(Int32Value(1));
case JSOP_NULL:
return pushConstant(NullValue());
+ case JSOP_VOID:
+ current->pop();
+ return pushConstant(UndefinedValue());
+
case JSOP_FALSE:
return pushConstant(BooleanValue(false));
case JSOP_TRUE:
return pushConstant(BooleanValue(true));
case JSOP_GETARG:
current->pushArg(GET_SLOTNO(pc));
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/void.js
@@ -0,0 +1,6 @@
+function f() {
+ var b, c;
+ var a = void ( b = 5, c = 7 );
+ return a;
+}
+assertEq(typeof f(), "undefined")