How to use the caffeine-script-runtime.defMod function in caffeine-script-runtime

To help you get started, we’ve selected a few caffeine-script-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / ComplexToJs / ThrowStn.js View on Github external
"use strict";
let Caf = require("caffeine-script-runtime");
Caf.defMod(module, () => {
  let ThrowStn;
  return ThrowStn = Caf.defClass(
    class ThrowStn extends require("../BaseStn") {},
    function(ThrowStn, classSuper, instanceSuper) {
      this.prototype.toJs = function(options = {}) {
        return options.expression
          ? `(()=>{${Caf.toString(this.toJs())};})()`
          : `throw ${Caf.toString(this.childrenToJs())}`;
      };
    }
  );
});
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / JustToJs / ArraySpreadElementStn.js View on Github external
"use strict";
let Caf = require("caffeine-script-runtime");
Caf.defMod(module, () => {
  return (() => {
    let ArraySpreadElementStn;
    return (ArraySpreadElementStn = Caf.defClass(
      class ArraySpreadElementStn extends require("../BaseStn") {},
      function(ArraySpreadElementStn, classSuper, instanceSuper) {
        this.prototype.toSourceNode = function() {
          return this.createSourceNode("...", this.childrenToSourceNodes());
        };
      }
    ));
  })();
});
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / SimpleToJs / ArraySpreadElementStn.js View on Github external
"use strict";
let Caf = require("caffeine-script-runtime");
Caf.defMod(module, () => {
  let ArraySpreadElementStn;
  return ArraySpreadElementStn = Caf.defClass(
    class ArraySpreadElementStn extends require("../BaseStn") {},
    function(ArraySpreadElementStn, classSuper, instanceSuper) {
      this.prototype.toJs = function() {
        return `...${Caf.toString(this.childrenToJs())}`;
      };
    }
  );
});
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / StnsGeneratingJs / UndefinedStn.js View on Github external
"use strict";
let Caf = require("caffeine-script-runtime");
Caf.defMod(module, () => {
  return (() => {
    let UndefinedStn;
    return (UndefinedStn = Caf.defClass(
      class UndefinedStn extends require("../BaseStn") {},
      function(UndefinedStn, classSuper, instanceSuper) {
        this.prototype.toSourceNode = function() {
          return this.createSourceNode("undefined");
        };
      }
    ));
  })();
});
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / GlobalIdentifierStn.js View on Github external
"use strict";
let Caf = require("caffeine-script-runtime");
Caf.defMod(module, () => {
  let GlobalIdentifierStn;
  return GlobalIdentifierStn = Caf.defClass(
    class GlobalIdentifierStn extends require("./BaseStn") {},
    function(GlobalIdentifierStn, classSuper, instanceSuper) {
      this.prototype.needsParens = false;
      this.prototype.toJs = function() {
        return this.props.identifier;
      };
    }
  );
});

caffeine-script-runtime

Runtime library for CaffeineScript

ISC
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages