#define // This is the master file for minified source, containing various tricks to shrink it as far as possible. #define // After being fed through gpp, all leading whitespace on every line is removed, and then all line breaks are removed. #define // End result, an ECMAScript module of fully minified code. #define Opcode.CreateElement 0 #define Opcode.CreateSvgElement 1 #define Opcode.CreateTextNode 2 #define Opcode.CreateComment 3 #define Opcode.CreateDocumentFragment 4 #define Opcode.SetData 5 #define Opcode.SetAttribute 6 #define Opcode.RemoveAttribute 7 #define Opcode.AppendChild 8 #define Opcode.InsertBefore 9 #define Opcode.Free 10 #define // Global variables (the textDecoder/var1 collision is fine) #define textDecoder t #define readString a #define // Local variables of execute(), readString() and maybe a little else #define instructions e #define nodes s #define offset b #define var1 t #define var2 r #define var3 c #define length n #define // Local variables of push_node (also uses nodes) #define node t #define id a #define // VM instance properties #define NODES t #define NEXT_ID a #define push_node e export default class VM{ constructor(){ # define // FIXME: is 0 document or what? (Perhaps I should define a “document” opcode rather than prefilling it?) # ifdef WITH_REALLOCATOR this.NEXT_ID = 0; # endif this.NODES=[]; } #ifdef WITH_REALLOCATOR push_node(node) { var nodes=this.NODES, id=this.NEXT_ID; id