Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I call the Tamarin ESC Compiler from AS3 Code?
    primarykey
    data
    text
    <p>I'm trying to call Tamarin's ESC Compiler from AS3 code. I've got the ESC Compiler byte code loaded in Flash Player, but when I call it, the ESC Compiler always returns the same do nothing byte code, no matter what source code I feed it. The human readable ESC code looks like this:</p> <pre><code>function compileStringToBytes(input, context="(string)", start_line=1) { let [_,_,res] = compile( (function () input), (function (abc) abc.getBytes()), context, start_line ); return res; } </code></pre> <p>I'm calling it using the following AS3 code:</p> <pre><code>var compile:Function = getDefinitionByName("ESC::compileStringToBytes") as Function; var array:ByteArray = compile( function():String { return "trace(\"hi\");" }, "test" ); </code></pre> <p>But no matter what source code I feed it, it always returns byte code of two functions, one that calls the other, with neither function doing anything.</p> <p>This is the byte code it returns (metadata stripped out, converted to human readable):</p> <pre><code>script0 const &lt;#internal test&gt;::internal:Namespace = &lt;#internal test&gt; /* slot_id 0 */ const &lt;#internal test&gt;::public:Namespace = /* slot_id 0 */ var Function:* /* slot_id 0 */ function script0$init():* /* disp_id 0*/ { // local_count=2 max_scope=1 max_stack=2 code_len=11 0 getlocal0 1 pushscope 2 findpropstrict Function 4 newfunction function ():* /* disp_id 0*/ 6 setproperty Function 8 getlocal1 9 returnvalue 10 returnvoid } function ():* /* disp_id 0*/ { // local_count=1 max_scope=0 max_stack=0 code_len=1 0 returnvoid } </code></pre> <p>Thanks in advance! I know this is hardcore question but I hope some hardcore coder can shed some light on it!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload