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
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
--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
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
https://cs.chromium.org/chromium/src/v8/src/runtime/runtime.h?l=20&rcl=05720af2b09a18be5c41bbf224a58f3f0618f6be |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script> |
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
import * as ts from 'typescript'; | |
const watchCompilerHost = ts.createWatchCompilerHost( | |
['index.ts'], | |
{strict: true, target: ts.ScriptTarget.ESNext}, | |
ts.sys, | |
); | |
const originalCreateProgram = watchCompilerHost.createProgram; | |
watchCompilerHost.watchFile = (path, callback) => { | |
// console.log('watchFile', path); | |
return { |
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
specification | |
interpretation | |
initialization | |
implementation | |
persistence | |
orientation | |
inheritance | |
environment | |
compilation | |
registration |
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
import * as React from 'react'; | |
import * as ReactDom from 'react-dom'; | |
type ZoneContext = {name: string; params?: {}; parent: ZoneContext | null; children: ZoneContext[]}; | |
const Context = React.createContext<ZoneContext | null>(null); | |
function useMetrika(someData?: {}) { | |
const context = React.useContext(Context); | |
const parents: ZoneContext[] = []; | |
if (context !== null) { | |
let ctx = context; |
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 prepare(n) { | |
const arr = []; | |
for (let i = 0; i < n; i++) { | |
arr[i] = {a: i % 2 === 0 ? -i : i, b: {h: {x: i}, c: {i: i, d: {e: {e: {u: {x: i}}}}}}}; | |
} | |
shuffleArray(arr); | |
return arr; | |
} | |
function shuffleArray(array) { | |
for (var i = array.length - 1; i > 0; i--) { |