[17 January 2020, 08:29:47] ROBERT PALMER: A presentation by Google on how they manage TypeScript. "code as cattle" one version of TypeScript.
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 applyFunctionsRest(functions, ...args) { | |
for (var i = 0, l = functions.length; i < l; ++i) { | |
functions[i].apply(this, args); | |
} | |
} | |
var safeApply = Function.prototype.call.bind(Function.prototype.apply); | |
function safeApplyFunctionsRest(functions, ...args) { | |
for (var i = 0, l = functions.length; i < l; ++i) { |
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
const TEST_LOOP_COUNT = 1e5; | |
const VAL = "woo"; | |
const DESC = { value: VAL, configurable: true, enumerable: true, writable: true }; | |
const propNames = [ "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9" ]; | |
const PROP_COUNT = propNames.length; | |
function literal () { | |
return { | |
[propNames[0]]: VAL, |
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() { | |
const Y_IX = 1e6; | |
const str = "x".repeat(Y_IX) + "y"; | |
function regexp (str) { | |
return /y/.exec(str).index; | |
} |
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
// Micro-benchmark to answer the question in https://twitter.com/thejameskyle/status/905403367949647874 | |
if (typeof console === 'undefined') console = {log:print}; | |
var closuresOriginal = (function() { | |
const outer = a => { | |
const inner = b => a + b; | |
return inner(2); | |
}; |
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
// Micro-benchmark to answer the question in https://twitter.com/thejameskyle/status/905403367949647874 | |
if (typeof console === 'undefined') console = {log:print}; | |
var closuresOriginal = (function() { | |
const outer = a => { | |
const inner = b => a + b; | |
return inner(2); | |
}; |
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 empty () {} | |
const fnsLength = 10; | |
const fns = new Array(fnsLength).fill(empty); | |
const fnStrings = fns.map(x => x.toString()); | |
var ix = 0; |
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 ts_versionMajorMinor, | |
ts_version, | |
ts_tryGetNativeMap, | |
ts_Map, | |
ts_createMapShim, | |
ts_emptyArray, | |
ts_createMap, | |
ts_createMapFromEntries, | |
ts_createMapFromTemplate, | |
ts_length, |