[JAEGER] Merge from fatval branch.
authorDavid Anderson <danderson@mozilla.com>
Fri, 04 Jun 2010 22:21:00 -0700
changeset 52702 cb2d305330698e5b44ccd6d9748427f715bd3cad
parent 52700 a9ffda177cafd325f27194a655d580d128ee03cc (current diff)
parent 52701 215ec672df104c419b38e2b16f69e16cbcff9cd3 (diff)
child 52703 55b5e2d14a988bb4b64b56be9052b7f9627d1189
push idunknown
push userunknown
push dateunknown
milestone1.9.3a5pre
[JAEGER] Merge from fatval branch.
js/src/jsopcode.cpp
js/src/shell/js.cpp
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -366,18 +366,22 @@ js_Disassemble1(JSContext *cx, JSScript 
         fprintf(fp, " %u (%d)", loc + (intN) off, (intN) off);
         break;
 
       case JOF_ATOM:
       case JOF_OBJECT:
       case JOF_REGEXP:
         index = js_GetIndexFromBytecode(cx, script, pc, 0);
         if (type == JOF_ATOM) {
-            JS_GET_SCRIPT_ATOM(script, pc, index, atom);
-            v = ATOM_TO_JSVAL(atom);
+            if (op == JSOP_DOUBLE) {
+                v = Jsvalify(script->getConst(index));
+            } else {
+                JS_GET_SCRIPT_ATOM(script, pc, index, atom);
+                v = ATOM_TO_JSVAL(atom);
+            }
         } else {
             if (type == JOF_OBJECT)
                 obj = script->getObject(index);
             else
                 obj = script->getRegExp(index);
             v = OBJECT_TO_JSVAL(obj);
         }
         bytes = ToDisassemblySource(cx, v);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1880,16 +1880,19 @@ DisassFile(JSContext *cx, JSObject *obj,
     filename = JS_GetStringBytes(str);
     oldopts = JS_GetOptions(cx);
     JS_SetOptions(cx, oldopts | JSOPTION_COMPILE_N_GO | JSOPTION_NO_SCRIPT_RVAL);
     script = JS_CompileFile(cx, obj, filename);
     JS_SetOptions(cx, oldopts);
     if (!script)
         return JS_FALSE;
 
+    if (script->isEmpty())
+        return JS_TRUE;
+
     obj = JS_NewScriptObject(cx, script);
     if (!obj)
         return JS_FALSE;
 
     *rval = OBJECT_TO_JSVAL(obj); /* I like to root it, root it. */
     ok = Disassemble(cx, obj, 1, rval, rval); /* gross, but works! */
     *rval = JSVAL_VOID;