This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Worker from "workerize-loader!./worker" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loaderUtils = require("loader-utils"); | |
var parse = require("can-stache-ast").parse; | |
function makeRenderer(imports, intermediate, filename) { | |
intermediate = JSON.stringify(intermediate); | |
filename = JSON.stringify(filename); | |
imports = imports.map(function(imported) { | |
imported = JSON.stringify(imported); | |
return `${imported} : Promise.resolve(require(${imported}))` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isFunction = require('../is-function/is-function'); | |
var global = require("../global/global")(); | |
/** | |
* @module {function} can-util/js/import/import import | |
* @parent can-util/js | |
* @signature `importModule(moduleName, parentName)` | |
* | |
* ```js | |
* var importModule = require("can-util/js/import/import"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Literal( text ) { | |
this.text = text; | |
} | |
Literal.prototype = new tree.Node(); | |
Literal.prototype.constructor = Literal; | |
Literal.prototype.type = "Literal"; | |
Literal.prototype.accept = function ( visitor ) {}; | |
Literal.prototype.eval = function ( context ) { | |
return new Literal( this.text ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.each(@list, @ruleset) { | |
@plugin "plugins/lambda"; | |
@length : length(@list); | |
._iterate(1); | |
._iterate(@index) when (@index =< @length) { | |
@item : extract(@list, @index); | |
@lambda : lambda(@item, @index, item index, @ruleset); | |
@lambda(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @mixin | |
// Loops over all items in the specified list and for each item executes | |
// a special `.\\` mixin declared by the specified ruleset. The ruleset | |
// and mixin combination is used to emulate a lambda function delegate. | |
// @param {List} list | |
// The list over which to loop. | |
// @param {Ruleset} lambda | |
// A ruleset that may define the `.\\` mixin that is used to process the | |
// individual list items. The mixin should correspond to the | |
// following signature: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
can.compute.when = function( computer ) { | |
var | |
promise, | |
combined, | |
result; | |
// Ensure that we always get back a then-able promise from `computer`, | |
// and that it is infact a `can.compute` and not a regular function. | |
promise = can.compute( function() { return can.when( computer()) }); |