Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a new runmode call 'browserify'. It works a lot like 'node' but it

makes a direct inclusion of the iced runtime, rather than an inclusion
through the top-level 'iced-coffee-script' module.  We can't go through
the top-level module since because browersify chokes on it.
  • Loading branch information...
commit 1b2034e8e847543e638ca0b8d56f2a0dcd3c5e2e 1 parent b53cdfc
@maxtaco authored
View
4 extras/coffee-script-iced-large.js
@@ -1,8 +1,8 @@
/**
- * IcedCoffeeScript Compiler v1.4.0b
+ * IcedCoffeeScript Compiler v1.4.0c
* http://maxtaco.github.com/coffee-script
*
* Copyright 2013, Jeremy Ashkenas, Maxwell Krohn
* Released under the MIT License
*/
-(function(e){var t=function(){function e(t){return e[t]}return e["./iced"]=new function(){var e=this;(function(){var t,n=[].slice;e.generator=t=function(e,t,i){var r,s,o,a,c,u;return t.transform=function(e){return e.icedTransform()},t["const"]=r={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none"],trampoline:"trampoline"},e.makeDeferReturn=function(t,i,s,o,a){var c,u,l,h;l={};for(c in o)h=o[c],l[c]=h;return l[r.lineno]=null!=i?i[r.lineno]:void 0,u=function(){var r,o,c;return r=arguments.length>=1?n.call(arguments,0):[],null!=i&&null!=(c=i.assign_fn)&&c.apply(null,r),t?(o=t,a||(t=null),o._fulfill(s,l)):e._warn("overused deferral at "+e._trace_to_string(l))},u[r.trace]=l,u},e.__c=0,e.tickCounter=function(t){return e.__c++,0===e.__c%t?(e.__c=0,!0):!1},e.__active_trace=null,e._trace_to_string=function(e){var t;return t=e[r.funcname]||"<anonymous>",""+t+" ("+e[r.filename]+":"+(e[r.lineno]+1)+")"},e._warn=function(e){return"undefined"!=typeof console&&null!==console?console.log("ICED warning: "+e):void 0},i.trampoline=function(t){return e.tickCounter(500)?"undefined"!=typeof process&&null!==process?process.nextTick(t):setTimeout(t):t()},i.Deferrals=s=function(){function t(e,t){this.trace=t,this.continuation=e,this.count=1,this.ret=null}return t.prototype._call=function(t){var n;return this.continuation?(e.__active_trace=t,n=this.continuation,this.continuation=null,n(this.ret)):e._warn("Entered dead await at "+e._trace_to_string(t))},t.prototype._fulfill=function(e,t){var n=this;return--this.count>0?void 0:i.trampoline(function(){return n._call(t)})},t.prototype.defer=function(t){var n;return this.count++,n=this,e.makeDeferReturn(n,t,null,this.trace)},t}(),i.findDeferral=c=function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)if(t=e[n],null!=t?t[r.trace]:void 0)return t;return null},i.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0,this[r.deferrals]=this}var n;return n=function(){function e(e,t,n){this.rv=e,this.id=t,this.multi=n}return e.prototype.defer=function(e){return this.rv._deferWithId(this.id,e,this.multi)},e}(),t.prototype.wait=function(e){var t;return this.completed.length?(t=this.completed.shift(),e(t)):this.waiters.push(e)},t.prototype.defer=function(e){var t;return t=this.defer_id++,this.deferWithId(t,e)},t.prototype.id=function(e,t){var i;return null==t&&(t=!1),i={},i[r.deferrals]=new n(this,e,t),i},t.prototype._fulfill=function(e){var t;return this.waiters.length?(t=this.waiters.shift(),t(e)):this.completed.push(e)},t.prototype._deferWithId=function(t,n,i){return this.count++,e.makeDeferReturn(this,n,t,{},i)},t}(),i.stackWalk=u=function(t){var n,i,s,o;for(i=[],s=t?t[r.trace]:e.__active_trace;s;)n=" at "+e._trace_to_string(s),i.push(n),s=null!=s?null!=(o=s[r.parent])?o[r.trace]:void 0:void 0;return i},i.exceptionHandler=a=function(e,t){var n;return t||(t=console.log),t(e.stack),n=u(),n.length?(t("Iced 'stack' trace (w/ real line numbers):"),t(n.join("\n"))):void 0},i.catchExceptions=function(e){return"undefined"!=typeof process&&null!==process?process.on("uncaughtException",function(t){return a(t,e),process.exit(1)}):void 0}},e.runtime={},t(this,e,e.runtime)}).call(this)},e["./icedlib"]=new function(){var t=this;(function(){var n,i,r,s,o,a,c,u,l=[].slice;s=o=function(){},r=e("./iced"),t.iced=i=r.runtime,u=function(e,t,n,r){var s,a,c,u,h,p;p=o,u=i.findDeferral(arguments),a=new i.Rendezvous,r[0]=a.id(!0).__iced_deferrals.defer({assign_fn:function(){return function(){return s=l.call(arguments,0)}}(),lineno:17}),setTimeout(a.id(!1).__iced_deferrals.defer({lineno:18}),t),function(e){h=new i.Deferrals(e,{parent:u,filename:"src/icedlib.coffee",funcname:"_timeout"}),a.wait(h.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:20})),h._fulfill()}(function(){return n&&(n[0]=c),e.apply(null,s)})},t.timeout=function(e,t,n){var i;return i=[],u(e,t,n,i),i[0]},a=function(e,t,n){var r,s,a,c;c=o,s=i.findDeferral(arguments),function(e){a=new i.Deferrals(e,{parent:s,filename:"src/icedlib.coffee",funcname:"_iand"}),n[0]=a.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:35}),a._fulfill()}(function(){return r||(t[0]=!1),e()})},t.iand=function(e,t){var n;return n=[],a(e,t,n),n[0]},c=function(e,t,n){var r,s,a,c;c=o,s=i.findDeferral(arguments),function(e){a=new i.Deferrals(e,{parent:s,filename:"src/icedlib.coffee",funcname:"_ior"}),n[0]=a.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:52}),a._fulfill()}(function(){return r&&(t[0]=!0),e()})},t.ior=function(e,t){var n;return n=[],c(e,t,n),n[0]},t.Pipeliner=n=function(){function e(e,t){this.window=e||1,this.delay=t||0,this.queue=[],this.n_out=0,this.cb=null,this[r["const"].deferrals]=this,this.defer=this._defer}return e.prototype.waitInQueue=function(e){var t,n,r,s=this;r=o,t=i.findDeferral(arguments),function(e){var r,o;r=[],o=function(e){var a,c,u;return a=function(){return e(r)},c=function(){return i.trampoline(function(){return o(e)})},u=function(e){return r.push(e),c()},s.n_out>=s.window?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.waitInQueue"}),s.cb=n.defer({lineno:88}),n._fulfill()}(u),void 0):a()},o(e)}(function(){s.n_out++,function(e){return s.delay?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.waitInQueue"}),setTimeout(n.defer({lineno:96}),s.delay),n._fulfill()}(e),void 0):e()}(function(){return e()})})},e.prototype.__defer=function(e,t){var n,r,s,a,c,u=this;c=o,s=i.findDeferral(arguments),function(n){a=new i.Deferrals(n,{parent:s,filename:"src/icedlib.coffee",funcname:"Pipeliner.__defer"}),r=a.defer({lineno:109}),e[0]=function(){var e,n;return e=arguments.length>=1?l.call(arguments,0):[],null!=(n=t.assign_fn)&&n.apply(null,e),r()},a._fulfill()}(function(){return u.n_out--,u.cb?(n=u.cb,u.cb=null,n()):void 0})},e.prototype._defer=function(e){var t;return t=[],this.__defer(t,e),t[0]},e.prototype.flush=function(e){var t,n,r,s,o,a=this;r=e,t=i.findDeferral(arguments),s=[],o=function(e){var r,c,u;return r=function(){return e(s)},c=function(){return i.trampoline(function(){return o(e)})},u=function(e){return s.push(e),c()},a.n_out?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.flush"}),a.cb=n.defer({lineno:136}),n._fulfill()}(u),void 0):r()},o(r)},e}()}).call(this)},e["./icedlib"]}();"function"==typeof define&&define.amd?(define(function(){return t}),define(function(){return t.iced})):(e.icedlib=t,e.iced=t.iced)})(this);
+(function(e){var t=function(){function e(t){return e[t]}return e["./iced"]=new function(){var e=this;(function(){var t,n=[].slice;e.generator=t=function(e,t,i){var r,s,o,a,c,u;return t.transform=function(e){return e.icedTransform()},t["const"]=r={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",runtime:"runtime",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none","browserify"],trampoline:"trampoline"},e.makeDeferReturn=function(t,i,s,o,a){var c,u,l,h;l={};for(c in o)h=o[c],l[c]=h;return l[r.lineno]=null!=i?i[r.lineno]:void 0,u=function(){var r,o,c;return r=arguments.length>=1?n.call(arguments,0):[],null!=i&&null!=(c=i.assign_fn)&&c.apply(null,r),t?(o=t,a||(t=null),o._fulfill(s,l)):e._warn("overused deferral at "+e._trace_to_string(l))},u[r.trace]=l,u},e.__c=0,e.tickCounter=function(t){return e.__c++,0===e.__c%t?(e.__c=0,!0):!1},e.__active_trace=null,e._trace_to_string=function(e){var t;return t=e[r.funcname]||"<anonymous>",""+t+" ("+e[r.filename]+":"+(e[r.lineno]+1)+")"},e._warn=function(e){return"undefined"!=typeof console&&null!==console?console.log("ICED warning: "+e):void 0},i.trampoline=function(t){return e.tickCounter(500)?"undefined"!=typeof process&&null!==process?process.nextTick(t):setTimeout(t):t()},i.Deferrals=s=function(){function t(e,t){this.trace=t,this.continuation=e,this.count=1,this.ret=null}return t.prototype._call=function(t){var n;return this.continuation?(e.__active_trace=t,n=this.continuation,this.continuation=null,n(this.ret)):e._warn("Entered dead await at "+e._trace_to_string(t))},t.prototype._fulfill=function(e,t){var n=this;return--this.count>0?void 0:i.trampoline(function(){return n._call(t)})},t.prototype.defer=function(t){var n;return this.count++,n=this,e.makeDeferReturn(n,t,null,this.trace)},t}(),i.findDeferral=c=function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)if(t=e[n],null!=t?t[r.trace]:void 0)return t;return null},i.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0,this[r.deferrals]=this}var n;return n=function(){function e(e,t,n){this.rv=e,this.id=t,this.multi=n}return e.prototype.defer=function(e){return this.rv._deferWithId(this.id,e,this.multi)},e}(),t.prototype.wait=function(e){var t;return this.completed.length?(t=this.completed.shift(),e(t)):this.waiters.push(e)},t.prototype.defer=function(e){var t;return t=this.defer_id++,this.deferWithId(t,e)},t.prototype.id=function(e,t){var i;return null==t&&(t=!1),i={},i[r.deferrals]=new n(this,e,t),i},t.prototype._fulfill=function(e){var t;return this.waiters.length?(t=this.waiters.shift(),t(e)):this.completed.push(e)},t.prototype._deferWithId=function(t,n,i){return this.count++,e.makeDeferReturn(this,n,t,{},i)},t}(),i.stackWalk=u=function(t){var n,i,s,o;for(i=[],s=t?t[r.trace]:e.__active_trace;s;)n=" at "+e._trace_to_string(s),i.push(n),s=null!=s?null!=(o=s[r.parent])?o[r.trace]:void 0:void 0;return i},i.exceptionHandler=a=function(e,t){var n;return t||(t=console.log),t(e.stack),n=u(),n.length?(t("Iced 'stack' trace (w/ real line numbers):"),t(n.join("\n"))):void 0},i.catchExceptions=function(e){return"undefined"!=typeof process&&null!==process?process.on("uncaughtException",function(t){return a(t,e),process.exit(1)}):void 0}},e.runtime={},t(this,e,e.runtime)}).call(this)},e["./icedlib"]=new function(){var t=this;(function(){var n,i,r,s,o,a,c,u,l=[].slice;s=o=function(){},r=e("./iced"),t.iced=i=r.runtime,u=function(e,t,n,r){var s,a,c,u,h,p;p=o,u=i.findDeferral(arguments),a=new i.Rendezvous,r[0]=a.id(!0).__iced_deferrals.defer({assign_fn:function(){return function(){return s=l.call(arguments,0)}}(),lineno:17}),setTimeout(a.id(!1).__iced_deferrals.defer({lineno:18}),t),function(e){h=new i.Deferrals(e,{parent:u,filename:"src/icedlib.coffee",funcname:"_timeout"}),a.wait(h.defer({assign_fn:function(){return function(){return c=arguments[0]}}(),lineno:20})),h._fulfill()}(function(){return n&&(n[0]=c),e.apply(null,s)})},t.timeout=function(e,t,n){var i;return i=[],u(e,t,n,i),i[0]},a=function(e,t,n){var r,s,a,c;c=o,s=i.findDeferral(arguments),function(e){a=new i.Deferrals(e,{parent:s,filename:"src/icedlib.coffee",funcname:"_iand"}),n[0]=a.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:35}),a._fulfill()}(function(){return r||(t[0]=!1),e()})},t.iand=function(e,t){var n;return n=[],a(e,t,n),n[0]},c=function(e,t,n){var r,s,a,c;c=o,s=i.findDeferral(arguments),function(e){a=new i.Deferrals(e,{parent:s,filename:"src/icedlib.coffee",funcname:"_ior"}),n[0]=a.defer({assign_fn:function(){return function(){return r=arguments[0]}}(),lineno:52}),a._fulfill()}(function(){return r&&(t[0]=!0),e()})},t.ior=function(e,t){var n;return n=[],c(e,t,n),n[0]},t.Pipeliner=n=function(){function e(e,t){this.window=e||1,this.delay=t||0,this.queue=[],this.n_out=0,this.cb=null,this[r["const"].deferrals]=this,this.defer=this._defer}return e.prototype.waitInQueue=function(e){var t,n,r,s=this;r=o,t=i.findDeferral(arguments),function(e){var r,o;r=[],o=function(e){var a,c,u;return a=function(){return e(r)},c=function(){return i.trampoline(function(){return o(e)})},u=function(e){return r.push(e),c()},s.n_out>=s.window?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.waitInQueue"}),s.cb=n.defer({lineno:88}),n._fulfill()}(u),void 0):a()},o(e)}(function(){s.n_out++,function(e){return s.delay?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.waitInQueue"}),setTimeout(n.defer({lineno:96}),s.delay),n._fulfill()}(e),void 0):e()}(function(){return e()})})},e.prototype.__defer=function(e,t){var n,r,s,a,c,u=this;c=o,s=i.findDeferral(arguments),function(n){a=new i.Deferrals(n,{parent:s,filename:"src/icedlib.coffee",funcname:"Pipeliner.__defer"}),r=a.defer({lineno:109}),e[0]=function(){var e,n;return e=arguments.length>=1?l.call(arguments,0):[],null!=(n=t.assign_fn)&&n.apply(null,e),r()},a._fulfill()}(function(){return u.n_out--,u.cb?(n=u.cb,u.cb=null,n()):void 0})},e.prototype._defer=function(e){var t;return t=[],this.__defer(t,e),t[0]},e.prototype.flush=function(e){var t,n,r,s,o,a=this;r=e,t=i.findDeferral(arguments),s=[],o=function(e){var r,c,u;return r=function(){return e(s)},c=function(){return i.trampoline(function(){return o(e)})},u=function(e){return s.push(e),c()},a.n_out?(function(e){n=new i.Deferrals(e,{parent:t,filename:"src/icedlib.coffee",funcname:"Pipeliner.flush"}),a.cb=n.defer({lineno:136}),n._fulfill()}(u),void 0):r()},o(r)},e}()}).call(this)},e["./icedlib"]}();"function"==typeof define&&define.amd?(define(function(){return t}),define(function(){return t.iced})):(e.icedlib=t,e.iced=t.iced)})(this);
View
4 extras/coffee-script-iced.js
@@ -1,8 +1,8 @@
/**
- * IcedCoffeeScript Compiler v1.4.0b
+ * IcedCoffeeScript Compiler v1.4.0c
* http://maxtaco.github.com/coffee-script
*
* Copyright 2013, Jeremy Ashkenas, Maxwell Krohn
* Released under the MIT License
*/
-(function(e){var t=function(){function e(t){return e[t]}return e["./iced"]=new function(){var e=this;(function(){var t,n=[].slice;e.generator=t=function(e,t,i){var r,s,o,a,c,u;return t.transform=function(e){return e.icedTransform()},t["const"]=r={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none"],trampoline:"trampoline"},e.makeDeferReturn=function(t,i,s,o,a){var c,u,l,h;l={};for(c in o)h=o[c],l[c]=h;return l[r.lineno]=null!=i?i[r.lineno]:void 0,u=function(){var r,o,c;return r=arguments.length>=1?n.call(arguments,0):[],null!=i&&null!=(c=i.assign_fn)&&c.apply(null,r),t?(o=t,a||(t=null),o._fulfill(s,l)):e._warn("overused deferral at "+e._trace_to_string(l))},u[r.trace]=l,u},e.__c=0,e.tickCounter=function(t){return e.__c++,0===e.__c%t?(e.__c=0,!0):!1},e.__active_trace=null,e._trace_to_string=function(e){var t;return t=e[r.funcname]||"<anonymous>",""+t+" ("+e[r.filename]+":"+(e[r.lineno]+1)+")"},e._warn=function(e){return"undefined"!=typeof console&&null!==console?console.log("ICED warning: "+e):void 0},i.trampoline=function(t){return e.tickCounter(500)?"undefined"!=typeof process&&null!==process?process.nextTick(t):setTimeout(t):t()},i.Deferrals=s=function(){function t(e,t){this.trace=t,this.continuation=e,this.count=1,this.ret=null}return t.prototype._call=function(t){var n;return this.continuation?(e.__active_trace=t,n=this.continuation,this.continuation=null,n(this.ret)):e._warn("Entered dead await at "+e._trace_to_string(t))},t.prototype._fulfill=function(e,t){var n=this;return--this.count>0?void 0:i.trampoline(function(){return n._call(t)})},t.prototype.defer=function(t){var n;return this.count++,n=this,e.makeDeferReturn(n,t,null,this.trace)},t}(),i.findDeferral=c=function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)if(t=e[n],null!=t?t[r.trace]:void 0)return t;return null},i.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0,this[r.deferrals]=this}var n;return n=function(){function e(e,t,n){this.rv=e,this.id=t,this.multi=n}return e.prototype.defer=function(e){return this.rv._deferWithId(this.id,e,this.multi)},e}(),t.prototype.wait=function(e){var t;return this.completed.length?(t=this.completed.shift(),e(t)):this.waiters.push(e)},t.prototype.defer=function(e){var t;return t=this.defer_id++,this.deferWithId(t,e)},t.prototype.id=function(e,t){var i;return null==t&&(t=!1),i={},i[r.deferrals]=new n(this,e,t),i},t.prototype._fulfill=function(e){var t;return this.waiters.length?(t=this.waiters.shift(),t(e)):this.completed.push(e)},t.prototype._deferWithId=function(t,n,i){return this.count++,e.makeDeferReturn(this,n,t,{},i)},t}(),i.stackWalk=u=function(t){var n,i,s,o;for(i=[],s=t?t[r.trace]:e.__active_trace;s;)n=" at "+e._trace_to_string(s),i.push(n),s=null!=s?null!=(o=s[r.parent])?o[r.trace]:void 0:void 0;return i},i.exceptionHandler=a=function(e,t){var n;return t||(t=console.log),t(e.stack),n=u(),n.length?(t("Iced 'stack' trace (w/ real line numbers):"),t(n.join("\n"))):void 0},i.catchExceptions=function(e){return"undefined"!=typeof process&&null!==process?process.on("uncaughtException",function(t){return a(t,e),process.exit(1)}):void 0}},e.runtime={},t(this,e,e.runtime)}).call(this)},e["./iced"]}();"function"==typeof define&&define.amd?define(function(){return t.runtime}):e.iced=t.runtime})(this);
+(function(e){var t=function(){function e(t){return e[t]}return e["./iced"]=new function(){var e=this;(function(){var t,n=[].slice;e.generator=t=function(e,t,i){var r,s,o,a,c,u;return t.transform=function(e){return e.icedTransform()},t["const"]=r={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",runtime:"runtime",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none","browserify"],trampoline:"trampoline"},e.makeDeferReturn=function(t,i,s,o,a){var c,u,l,h;l={};for(c in o)h=o[c],l[c]=h;return l[r.lineno]=null!=i?i[r.lineno]:void 0,u=function(){var r,o,c;return r=arguments.length>=1?n.call(arguments,0):[],null!=i&&null!=(c=i.assign_fn)&&c.apply(null,r),t?(o=t,a||(t=null),o._fulfill(s,l)):e._warn("overused deferral at "+e._trace_to_string(l))},u[r.trace]=l,u},e.__c=0,e.tickCounter=function(t){return e.__c++,0===e.__c%t?(e.__c=0,!0):!1},e.__active_trace=null,e._trace_to_string=function(e){var t;return t=e[r.funcname]||"<anonymous>",""+t+" ("+e[r.filename]+":"+(e[r.lineno]+1)+")"},e._warn=function(e){return"undefined"!=typeof console&&null!==console?console.log("ICED warning: "+e):void 0},i.trampoline=function(t){return e.tickCounter(500)?"undefined"!=typeof process&&null!==process?process.nextTick(t):setTimeout(t):t()},i.Deferrals=s=function(){function t(e,t){this.trace=t,this.continuation=e,this.count=1,this.ret=null}return t.prototype._call=function(t){var n;return this.continuation?(e.__active_trace=t,n=this.continuation,this.continuation=null,n(this.ret)):e._warn("Entered dead await at "+e._trace_to_string(t))},t.prototype._fulfill=function(e,t){var n=this;return--this.count>0?void 0:i.trampoline(function(){return n._call(t)})},t.prototype.defer=function(t){var n;return this.count++,n=this,e.makeDeferReturn(n,t,null,this.trace)},t}(),i.findDeferral=c=function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)if(t=e[n],null!=t?t[r.trace]:void 0)return t;return null},i.Rendezvous=o=function(){function t(){this.completed=[],this.waiters=[],this.defer_id=0,this[r.deferrals]=this}var n;return n=function(){function e(e,t,n){this.rv=e,this.id=t,this.multi=n}return e.prototype.defer=function(e){return this.rv._deferWithId(this.id,e,this.multi)},e}(),t.prototype.wait=function(e){var t;return this.completed.length?(t=this.completed.shift(),e(t)):this.waiters.push(e)},t.prototype.defer=function(e){var t;return t=this.defer_id++,this.deferWithId(t,e)},t.prototype.id=function(e,t){var i;return null==t&&(t=!1),i={},i[r.deferrals]=new n(this,e,t),i},t.prototype._fulfill=function(e){var t;return this.waiters.length?(t=this.waiters.shift(),t(e)):this.completed.push(e)},t.prototype._deferWithId=function(t,n,i){return this.count++,e.makeDeferReturn(this,n,t,{},i)},t}(),i.stackWalk=u=function(t){var n,i,s,o;for(i=[],s=t?t[r.trace]:e.__active_trace;s;)n=" at "+e._trace_to_string(s),i.push(n),s=null!=s?null!=(o=s[r.parent])?o[r.trace]:void 0:void 0;return i},i.exceptionHandler=a=function(e,t){var n;return t||(t=console.log),t(e.stack),n=u(),n.length?(t("Iced 'stack' trace (w/ real line numbers):"),t(n.join("\n"))):void 0},i.catchExceptions=function(e){return"undefined"!=typeof process&&null!==process?process.on("uncaughtException",function(t){return a(t,e),process.exit(1)}):void 0}},e.runtime={},t(this,e,e.runtime)}).call(this)},e["./iced"]}();"function"==typeof define&&define.amd?define(function(){return t.runtime}):e.iced=t.runtime})(this);
View
8 extras/coffee-script.js
4 additions, 4 deletions not shown
View
2  lib/coffee-script/browser.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var CoffeeScript, runScripts;
View
2  lib/coffee-script/cake.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
View
4 lib/coffee-script/coffee-script.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var EXTENSIONS, Lexer, RESERVED, compile, e, fs, iced, isCoffeeFile, lexer, parser, path, vm, _i, _j, _len, _len1, _ref,
__hasProp = {}.hasOwnProperty;
@@ -46,7 +46,7 @@
}
}
- exports.VERSION = '1.4.0b';
+ exports.VERSION = '1.4.0c';
exports.RESERVED = RESERVED;
View
2  lib/coffee-script/command.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, handleIcedOptions, helpers, hidden, iced, joinTimeout, lint, loadRequires, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, runtime_modes_str, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
View
2  lib/coffee-script/grammar.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
View
2  lib/coffee-script/helpers.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var extend, flatten, _ref;
View
5 lib/coffee-script/iced.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var generator,
__slice = [].slice;
@@ -13,6 +13,7 @@
k_noop: "__iced_k_noop",
param: "__iced_p_",
ns: "iced",
+ runtime: "runtime",
Deferrals: "Deferrals",
deferrals: "__iced_deferrals",
fulfill: "_fulfill",
@@ -34,7 +35,7 @@
filename: "filename",
funcname: "funcname",
catchExceptions: 'catchExceptions',
- runtime_modes: ["node", "inline", "window", "none"],
+ runtime_modes: ["node", "inline", "window", "none", "browserify"],
trampoline: "trampoline"
};
intern.makeDeferReturn = function(obj, defer_args, id, trace_template, multi) {
View
2  lib/coffee-script/icedlib.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var Pipeliner, iced, iced_internals, __iced_k, __iced_k_noop, _iand, _ior, _timeout,
__slice = [].slice;
View
2  lib/coffee-script/index.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var key, val, _ref;
View
2  lib/coffee-script/lexer.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
View
16 lib/coffee-script/nodes.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var Access, Arr, Assign, Await, Base, Block, Call, Class, Closure, Code, Comment, CpsCascade, Defer, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, IcedReturnValue, IcedRuntime, IcedTailCall, If, In, Index, InlineRuntime, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NULL, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Slot, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, iced, last, merge, multident, some, starts, unfoldSoak, utility, _ref, _ref1,
__hasProp = {}.hasOwnProperty,
@@ -3046,7 +3046,7 @@
}
IcedRuntime.prototype.compileNode = function(o) {
- var access, assign, call, callv, file, inc, k, klass, lhs_vec, ns, req, rhs, v, val, window_mode, window_val, _i, _j, _len, _len1, _ref2;
+ var access, accessname, assign, call, callv, file, inc, k, klass, lhs_vec, modname, ns, req, rhs, v, val, window_mode, window_val, _i, _j, _len, _len1, _ref2;
this.expressions = [];
v = o.runtime ? o.runtime : o.bare ? "none" : this.foundDefer ? "node" : "none";
if (o.runtime && !this.foundDefer && !o.runforce) v = "none";
@@ -3061,8 +3061,16 @@
if (window_mode) window_val = new Value(new Literal(v));
return InlineRuntime.generate(window_val ? window_val.copy() : null);
case "node":
- file = new Literal("'iced-coffee-script'");
- access = new Access(new Literal(iced["const"].ns));
+ case "browserify":
+ if (v === "browserify") {
+ modname = "iced-coffee-script/lib/coffee-script/iced";
+ accessname = iced["const"].runtime;
+ } else {
+ modname = "iced-coffee-script";
+ accessname = iced["const"].ns;
+ }
+ file = new Literal("'" + modname + "'");
+ access = new Access(new Literal(accessname));
req = new Value(new Literal("require"));
call = new Call(req, [file]);
callv = new Value(call);
View
2  lib/coffee-script/optparse.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
View
19 lib/coffee-script/parser.js
@@ -1,4 +1,4 @@
-/* Jison generated parser */
+/* parser generated by jison 0.4.2 */
var parser = (function(){
var parser = {trace: function trace() { },
yy: {},
@@ -601,19 +601,16 @@ return new Parser;
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
exports.parser = parser;
exports.Parser = parser.Parser;
-exports.parse = function () { return parser.parse.apply(parser, arguments); }
+exports.parse = function () { return parser.parse.apply(parser, arguments); };
exports.main = function commonjsMain(args) {
- if (!args[1])
- throw new Error('Usage: '+args[0]+' FILE');
- var source, cwd;
- if (typeof process !== 'undefined') {
- source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
- } else {
- source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
+ if (!args[1]) {
+ console.log('Usage: '+args[0]+' FILE');
+ process.exit(1);
}
+ var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
return exports.parser.parse(source);
-}
+};
if (typeof module !== 'undefined' && require.main === module) {
- exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
+ exports.main(process.argv.slice(1));
}
}
View
2  lib/coffee-script/repl.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
View
2  lib/coffee-script/rewriter.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
View
2  lib/coffee-script/scope.js
@@ -1,4 +1,4 @@
-// Generated by IcedCoffeeScript 1.4.0b
+// Generated by IcedCoffeeScript 1.4.0c
(function() {
var Scope, extend, iced, last, _ref;
View
2  package.json
@@ -3,7 +3,7 @@
"description": "IcedCoffeeScript",
"keywords": ["javascript", "language", "coffeescript", "compiler"],
"author": "Maxwell Krohn",
- "version": "1.4.0b",
+ "version": "1.4.0c",
"licenses": [{
"type": "MIT",
"url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE"
View
2  src/coffee-script.coffee
@@ -32,7 +32,7 @@ else if require.registerExtension
require.registerExtension e, (content) -> compile content
# The current CoffeeScript version number.
-exports.VERSION = '1.4.0b'
+exports.VERSION = '1.4.0c'
# Words that cannot be used as identifiers in CoffeeScript code
exports.RESERVED = RESERVED
View
3  src/iced.coffee
@@ -26,6 +26,7 @@ exports.generator = generator = (intern, compiletime, runtime) ->
k_noop : "__iced_k_noop"
param : "__iced_p_"
ns: "iced"
+ runtime : "runtime"
Deferrals : "Deferrals"
deferrals : "__iced_deferrals"
fulfill : "_fulfill"
@@ -47,7 +48,7 @@ exports.generator = generator = (intern, compiletime, runtime) ->
filename : "filename"
funcname : "funcname"
catchExceptions : 'catchExceptions'
- runtime_modes : [ "node", "inline", "window", "none" ]
+ runtime_modes : [ "node", "inline", "window", "none", "browserify" ]
trampoline : "trampoline"
#### runtime
View
12 src/nodes.coffee
@@ -2499,9 +2499,15 @@ class IcedRuntime extends Block
if window_mode
window_val = new Value new Literal v
InlineRuntime.generate(if window_val then window_val.copy() else null)
- when "node"
- file = new Literal "'iced-coffee-script'"
- access = new Access new Literal iced.const.ns
+ when "node", "browserify"
+ if v is "browserify"
+ modname = "iced-coffee-script/lib/coffee-script/iced"
+ accessname = iced.const.runtime
+ else
+ modname = "iced-coffee-script"
+ accessname = iced.const.ns
+ file = new Literal "'#{modname}'"
+ access = new Access new Literal accessname
req = new Value new Literal "require"
call = new Call req, [ file ]
callv = new Value call
Please sign in to comment.
Something went wrong with that request. Please try again.