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 foo, bar; | |
class Aaa { | |
constructor(a, b) { | |
this.a = a; | |
this.b = b; | |
} | |
} | |
class Bbb { |
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
--use-strict (enforce strict mode) | |
type: bool default: false | |
--es-staging (enable test-worthy harmony features (for internal use only)) | |
type: bool default: false | |
--harmony (enable all completed harmony features) | |
type: bool default: false | |
--harmony-shipping (enable all shipped harmony features) | |
type: bool default: true | |
--harmony-regexp-sequence (enable "RegExp Unicode sequence properties" (in progress)) | |
type: bool default: false |
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
function abc(obj, prop) { | |
for (let j = 0; j < 1e7; j++) { | |
var x = obj[prop]; | |
} | |
return x; | |
} | |
function abc2(obj) { | |
for (let j = 0; j < 1e7; j++) { | |
var x = obj.b; |
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
function create(fn, name) { | |
if (fn === undefined) return; | |
const callback = data => { | |
let ret; | |
new Promise(() => (ret = fn(data))); | |
return ret; | |
}; | |
callback.displayName = name; | |
return callback; | |
} |
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
// Поместите настраиваемые сочетания клавиш в этот файл, чтобы перезаписать клавиши по умолчанию. | |
[ | |
{ | |
"key": "cmd+k", | |
"command": "workbench.action.terminal.clear", | |
}, | |
{ | |
"key": "cmd+alt+i", | |
"command": "workbench.action.terminal.toggleTerminal" | |
}, |
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
type AtLeastOne<T, U = { [K in keyof T]: { [P in K]: T[P] } }> = { [P in keyof T]?: T[P] } & U[keyof U]; | |
type Exactify<Base, T extends Base> = Base & { [K in keyof T]: K extends keyof Base ? T[K] : never }; | |
declare function requireExact<X extends Exactify<{a: number}, X>>(x: X): void; | |
type Omit<T, Keys extends string> = Pick<T, Exclude<keyof T, Keys>>; | |
type IfEquals<X, Y, A=X, B=never> = | |
(<T>() => T extends X ? 1 : 2) extends | |
(<T>() => T extends Y ? 1 : 2) ? A : B; | |
type WritableKeys<T> = { |
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 arr = []; | |
function allDone() { console.log('All done') } | |
function replaceCallback(callback) { | |
if (typeof callback !== 'function') return callback; | |
arr.push(callback); | |
return function () { | |
var pos = arr.indexOf(callback); | |
if (pos > -1) arr.splice(pos, 1); | |
var res = callback.apply(this, arguments); | |
if (arr.length === 0) allDone(); |
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
"use strict"; | |
function Bar(props) { return null; } | |
React.createElement(Bar, { sdf: true, id: 'hello' }); | |
React.createElement("div", { id: 'hi' }, "abc"); | |
React.createElement("div", null, "abc"); |
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 prev = Date.now(); | |
var callbacks; | |
function wait() { | |
return new Promise((resolve) => { | |
if (Date.now() > prev + 8) { | |
if (callbacks === undefined) { | |
callbacks = []; | |
callbacks.push(resolve); | |
requestAnimationFrame(() => { | |
prev = Date.now(); |
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
eval | |
new Function | |
new GeneratorFunction | |
new AsyncFunction | |
setTimeout("eval") | |
setInterval("eval") | |
div.innerHTML | |
div.setAttribute("onclick", "eval") // all events | |
div.attributes.setNamedItem | |
div.attributes.setNamedItemNS |