Open a new JS namespace. You can then register symbol inside and call finalize() when its done.
1 enum Direction { up, down } 2 3 auto ctx = new DukContext(); 4 5 ctx.createNamespace("Com") 6 .register!Direction 7 .finalize(); 8 9 assert(ctx.evalString!int("Com.Direction.down") == 1);
See Implementation
Open a new JS namespace. You can then register symbol inside and call finalize() when its done.