UNPKG

sai-language

Version:

An object-oriented language designed to afford code comprehension and maintenance. Transpiles in-place to Javascript.

74 lines (70 loc) 2.54 kB
#!/usr/bin/env node // Javascript source for sai-utils.sai transpiled by SAI // "use strict"; var prototype=new function() { this.Constructor=function(){}; this.__tobelocked=[]; this.__tobefrozen=[]; this.__contracts=[]; this.__unverified=true; this.isof={}; return this; }(); var $AI=require("sai-library"); // Generated code follows var __context={"name":"sai-utils.sai","loader":"SAI.GetSourceFromPaths","path":"src/sai-utils.sai","mtime":"2018-03-19T13:49:52.797Z","fetched":"2018-03-19T13:49:58.349Z"}; var _SAI = require('sai-language'); var _PATH = require('path'); var isa = prototype.isa = 'SaiUtils'; var $bindfail = function(m) { throw new Error("SAI: A call to " + m + " on object " + isa + " has come unbound from any instance of that object. (If this is not in error, mark the declaration of " + m + " as unbound.)"); } prototype.isof['SaiUtils'] = { version: '0.0.0-unspecified', isa: isa, context: __context }; prototype.__tobelocked = prototype.__tobelocked.concat(["Instantiate", "LoadFile", "RegisterWithNode", "isa"]); prototype.__tobefrozen = prototype.__tobefrozen.concat(["isof"]); var $1g = prototype['Instantiate'] || function() {}; prototype['Instantiate'] = function(p) { var $_d, $_c, $ = this['Instantiate'] ? this : $bindfail('Instantiate'); { $AI.debug_op('oh, hi'); /*@:11*/ } }; var $2g = prototype['LoadFile'] || function() {}; prototype['LoadFile'] = function(p, _filename) { var $_d, $_c, _result, $0, _module = p, $ = this['LoadFile'] ? this : $bindfail('LoadFile'); { _SAI.config.paths.unshift(_PATH.dirname(_filename)); /*@:15*/ _result = _SAI.Require(_PATH.basename(_filename)); /*@:16*/ _SAI.config.paths.shift(); /*@:17*/ return (_result); /*@:18*/ } }; var $3g = prototype['RegisterWithNode'] || function() {}; prototype['RegisterWithNode'] = function(p) { var $2, _MODULE, _REQUIRE, $1, $ = this['RegisterWithNode'] ? this : $bindfail('RegisterWithNode'); { _REQUIRE = require; /*@:22*/ _MODULE = module; /*@:23*/ if (undefined !== ($2 = (_REQUIRE.extensions))) { $2.sai = function() { return ($.LoadFile).apply($, arguments); }; /*@:26*/ } } }; $AI.finalizePrototype(prototype); if (prototype.isof[prototype.isa].type === "singleton") { prototype.Constructor(); prototype.Instantiate(); } var result=prototype.isof[prototype.isa].type === "main" ? prototype.constructor() : prototype; exports=result; try { module.exports=result; } catch(e) {}; return result;