How to use the caffeine-script-runtime.defClass 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 / CafSourceMap / SourceMapConsumer.js View on Github external
(BaseClass, readVlqSequence, Error, String, JSON) => {
      let SourceMapConsumer;
      return (SourceMapConsumer = Caf.defClass(
        class SourceMapConsumer extends BaseClass {
          constructor(sourceMap) {
            super(...arguments);
            if (Caf.is(sourceMap, String)) {
              sourceMap = JSON.parse(sourceMap);
            }
            this.sourceMap = sourceMap;
          }
        },
        function(SourceMapConsumer, classSuper, instanceSuper) {
          this.getter({
            mappings: function() {
              return this.sourceMap.mappings;
            },
            sources: function() {
              return this.sourceMap.sources;
github caffeine-suite / caffeine-script / source / CaffeineScript / CafSourceMap / SourceNode.js View on Github external
(BaseClass, toInspectedObjects, SourceMapGenerator, String, Array) => {
      let SourceNode;
      return (SourceNode = Caf.defClass(
        class SourceNode extends BaseClass {
          constructor(sourceIndex, children) {
            super(...arguments);
            this.sourceIndex = sourceIndex;
            this.children = children;
          }
        },
        function(SourceNode, classSuper, instanceSuper) {
          this.property("sourceIndex", "children");
          this.getter({
            inspectedObjects: function() {
              return {
                sourceIndex: this.sourceIndex,
                children: toInspectedObjects(this.children)
              };
            }
github caffeine-suite / caffeine-script / source / CaffeineScript / CafSourceMap / SourceMapGenerator.js View on Github external
(BaseClass, JSON, merge, encodeVlq, String, Array, SourceLineColumnMap) => {
      let SourceMapGenerator;
      return (SourceMapGenerator = Caf.defClass(
        class SourceMapGenerator extends BaseClass {
          constructor(source, sourceFileName, generatedFileName) {
            super(...arguments);
            this.source = source;
            this.sourceFileName = sourceFileName;
            this.generatedFileName = generatedFileName;
            this._js = "";
            this._mappings = "";
            this._lastSourceLine = this._lastSourceColumn = this._lastGeneratedColumn = this._nextGeneratedColumn = 0;
            this._firstSegment = true;
            this._lastSourceIndex = -1;
            this._sourceLineColumnMap = new SourceLineColumnMap(this.source);
          }
        },
        function(SourceMapGenerator, classSuper, instanceSuper) {
          let reusableColLine;
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / PlaceholderStns / ComprehensionValueClauseStn.js View on Github external
return (() => {
    let ComprehensionValueClauseStn;
    return (ComprehensionValueClauseStn = Caf.defClass(
      class ComprehensionValueClauseStn extends require("../BaseStn") {},
      function(ComprehensionValueClauseStn, classSuper, instanceSuper) {
        this.getter({
          type: function() {
            return this.props.type;
          },
          value: function() {
            return this.labeledChildren.value;
          }
        });
      }
    ));
  })();
});
github caffeine-suite / caffeine-script / source / CaffeineScript / SemanticTree / ComplexToJs / ThrowStn.js View on Github external
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())}`;
      };
    }
  );
});

caffeine-script-runtime

Runtime library for CaffeineScript

ISC
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages