JavaScript Compiler Logic Error:

a.b.c = a.b = a = {};
alert(a.b.c);

assignment precedence is right-to-left, name lookup is left-to-right?

 

A JavaScript Compiler Maker written in JavaScript, (class project)

Using a modified LR1 parser with segmented statements to produce a LR2 look ahead to resolve complex state tables.

These are some of the modifications to JavaScript I plan on implementing:

  • Compile to Assembler, run on any machine (will also run in emulation mode)
  • Remove Closure (use a more direct approach "bind")
  • Sub-Functions with parent's "this" object
  • Make more information available to functions
    • local variable names
    • call stack
    • caller
  • True asynchronous function calls with multiple return / entry points
  • Temporally release execution, (Process Messages)
  • Entry points
  • Remove statement functions
  • Qualified Function Names " function my.trim() { }" ; (default is "window") (or we change global: "global = my;")
  • Extend language
    • SQL statements as Objects and Functions
    • Binary statements for access to binary structures
    • Go to statement / computed go to
    • External variables (array = employees)
    • Assembler Code in JavaScript,  R0 = 12;  SHL R0, 3; alert(R0);
  • Variable Length Binary for all values (strings, numbers, float, date, arrays, ...), no limits on numbers (i.e. date of any precision: "-15 trillion trillion years in Pico seconds")
  • Extend values list (bits, vectors, matrix, date, person, place, ...)
  • Make Strings, Numbers, Boolean ==> Objects, (All values are objects:  a = "clif"; a.type = 'person') (solves a lot of problems)
  • External Prototypes to Objects (person.print, speed.units)
  • Common Ground 3000 (CG3) transport, self defining variable length binary structures (no need to reformat binary to/from string, one format to use and to store)
  • Mutable Strings  (name[0] = name[0].toUpperCase())