This file contains hidden or 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
// | |
// Case 1 | |
// | |
var a = []; | |
var t = performance.now(); | |
for (var i = 0; i < 10000; i++) | |
a.push(new Promise(function(){})); | |
This file contains hidden or 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
// | |
// Closure | |
// | |
var a = []; // хранилище истансов, чтобы они не разрушались (не собирались GC) | |
var getClosure = function(a){ return function(b){ return fn(a, b); } }; | |
var t = performance.now(); | |
for (var i = 0; i < 10000; i++) | |
a.push(getClosure(i)); |
This file contains hidden or 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
<b:style src="./item.css"/> | |
<b:define name="nestedViewCount" type="bool"/> | |
<b:define name="satelliteName" type="bool"/> | |
<b:define name="namespace" type="bool"/> | |
<div class="basisjs-devpanel-ui-view-item"> | |
<div class="basisjs-devpanel-ui-view-item__title" event-click="toggle" event-mouseenter="enter" event-mouseleave="leave"> | |
<div class="basisjs-devpanel-ui-view-item__expander basisjs-devpanel-ui-view-item__expander_{nestedViewCount}"/> | |
<span class="basisjs-devpanel-ui-view-item__satelliteName basisjs-devpanel-ui-view-item__satelliteName_{satelliteName}"> | |
{satelliteName} |
This file contains hidden or 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
basis.require('basis.event'); | |
basis.require('basis.data'); | |
var datasetComputeFunctions = {}; | |
basis.data.AbstractDataset.extend({ | |
/** | |
* @param {string|Array.<string>=} events |
This file contains hidden or 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
basis.require('basis.data.value'); | |
basis.require('basis.dom'); | |
var DOM = basis.dom; | |
var BindValue = basis.data.value.BindValue; | |
var DOM_INSERT_HANDLER = function(value){ | |
DOM.insert(DOM.clear(this), value); | |
}; |
This file contains hidden or 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 ids = String( | |
this.req.param('id') || | |
this.req.param('ids') | |
).match(/(\d+)/g); |
This file contains hidden or 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
basis.require('basis.entity'); | |
basis.require('basis.data.index'); | |
// create type with single field, that used for EntitySet | |
var Item = basis.entity.createType('SomeType', { | |
value: Number | |
}); | |
// main Entity type | |
var DemoType = basis.entity.createType('DemoType', { |
This file contains hidden or 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
basis.require('basis.net'); | |
basis.net.AjaxTransport.prototype.requestHeaders['X-Requested-With'] = 'XMLHttpRequest'; | |
basis.net.AjaxTransport.prototype.requestHeaders['X-Powered-By'] = 'basis.js'; |
This file contains hidden or 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
basis.require('basis.data'); | |
basis.require('basis.data.property'); | |
basis.namespace('basis.data.property').extend({ | |
AbstractProperty: basis.data.Value | |
}); |
This file contains hidden or 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
basis.require('basis.data'); | |
(function(){ | |
var set_ = basis.data.Value.prototype.set; | |
basis.data.Value.prototype.set = function(value, forceEvent){ | |
var valueBeforeSet = this.value; | |
set_.call(this, value); | |