[Laszlo-dev] look familiar? Unknown type for PUSH: false
P T Withington
ptw at openlaszlo.org
Fri Jan 19 20:10:24 PST 2007
I think I have a getBoolean and putBoolean method to help in these
situations. But now that you are not in Python, perhaps you could
just put the appropriate type object? Like perhaps you arg parser
needs to convert "true" to true or "false" to false?
On 2007-01-19, at 22:23 EST, Benjamin Shine wrote:
> I figured a lot of this out.
> In java, 1 is different from "1" is different from true is
> different from "true" is different from Boolean.TRUE.
> In python, some of those are equal-ish.
> In javascript, some of those are equal-ish.
> Thus, exquisite care must be taken when trying to emit code that says
> var $debug=1
> to not get code that says
> var $debug="true"
> or
> var $debug=true
> etc.
>
> Also, it is not recommended to ever use Properties.put(Object,
> Object) because that introduces potential type mismatches which are
> not detectable until runtime. Anything that can put into a
> properties object can be gotten out with Properties.getProperty
> (String), which returns a String. So if you put something in with
> properties.put("somekey", anObj) where anObj is anything but a
> String, you get kablooey when doing properties.get("somekey").
>
>
> On Jan 19, 2007, at 4:20 PM, Benjamin Shine wrote:
>
>>
>> I'm hung up on this error, while trying to rewrite lzsc in java.
>> Does this look familiar to either of you? It arises later in
>> execution of the script compiler than my parsing of options,
>> inside Compiler.compile. (This is where we hit Tucker's awesome
>> comment FIXME: use a language with dynamic dispatch.)
>>
>> How can I figure out more about what's causing this?
>>
>> test-lzsc-v:
>> [java] got arg -v
>> [java] got arg --default=sc/tests/test.js
>> [java] Got --default (which means scriptfile to compile) sc/
>> tests/test.js
>> [java] got arg -osc/tests/test.out
>> [java] Got -o for outputfilename sc/tests/test.out
>> [java] using outfile sc/tests/test.out
>> [java] init compiler options{scriptfile=sc/tests/test.js,
>> runtime=swf7, flashCompilerCompatability=true,
>> compileTimeConstants={$dhtml=false, $as3=false, $js1=false,
>> $swf9=false, $swf7=true, $profile=false, $swf8=false,
>> $runtime=swf7, $svg=false, $as2=true, $debug=false, $j2me=false},
>> obfuscate=false, printCompilerOptions=true, cacheCompiles=true,
>> generateFunction2ForLZX=true, progress=true, processIncludes=true,
>> profile=false, outputfile=sc/tests/test.out,
>> generateFunction2=true, allowRoot=true,
>> createActivationObject=false, conditionalCompilation=true}
>> [java] resolve called with sc/tests/test.js
>> [java] going to open file ./sc/tests/test.js
>> [java] Assembling...
>> [java] Exception compiling scriptfile: Unknown type for PUSH:
>> false
>> [java] Unknown exception compiling in lzsc: Unknown type for
>> PUSH: false
>> [java] org.openlaszlo.sc.CompilerException: Unknown type for
>> PUSH: false
>> [java] at org.openlaszlo.sc.Instructions
>> $PUSHInstruction.writeArgs(Instructions.java:942)
>> [java] at org.openlaszlo.sc.Instructions
>> $ConcreteInstruction.writeBytes(Instructions.java:354)
>> [java] at org.openlaszlo.sc.Assembler.emit(Assembler.java:
>> 216)
>> [java] at org.openlaszlo.sc.Optimizer.flush
>> (Optimizer.java:37)
>> [java] at org.openlaszlo.sc.Optimizer.emit(Optimizer.java:
>> 123)
>> [java] at org.openlaszlo.sc.Optimizer.assemble
>> (Optimizer.java:50)
>> [java] at org.openlaszlo.sc.Compiler.compile
>> (Compiler.java:374)
>> [java] at org.openlaszlo.sc.lzsc.compile(lzsc.java:265)
>> [java] at org.openlaszlo.sc.lzsc.scriptcompile(lzsc.java:
>> 115)
>> [java] at org.openlaszlo.sc.LFCCompiler.compile
>> (LFCCompiler.java:6)
>> [java] at org.openlaszlo.sc.Main.main(Main.java:10)
>> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0
>> (Native Method)
>>
>>
>>
>>
>>
>> Benjamin Shine
>> Software Engineer, Open Laszlo / Laszlo Systems
>> ben at laszlosystems.com
>>
>>
>>
>
More information about the Laszlo-dev
mailing list