View nashorn-property-access.js
var reassign = loadWithNewGlobal({
script: '(function (o, i) { o[i] = o[i]; })',
name: 'test.js'
});
function test(i) {
var o = {};
o[i] = true;
reassign(o, i);
print(JSON.stringify(o));
View .babelrc
{"plugins": ["syntax-flow", "transform-es2015-classes"]}
View nashorn-heap.js
var print = print || console.log;
var x = [];
for (var i = 0; i < 1000; i++) {
print(i);
x.push({"524288": 1});
}
View README.md
$ yarn flow
yarn flow v0.20.0
$ flow; test $? -eq 0 -o $? -eq 2
b.js:4
  4:   dict: {[key: string]: string},
             ^^^^^^^^^^^^^^^^^^^^^^^ some property. Property not found in
 11:     dict: {'key': 'value'}
               ^^^^^^^^^^^^^^^^ object literal
View cli-highlight.js
const lines = str.trim().split('\n');
const groups = [];
let input;
lines.forEach((line) => {
if (input) {
input.push(line);
if (line[line.length - 1] !== '\\') {
input = null;
}
} else if (line.startsWith('$ ')) {
View webpack.config.js
module.exports = () => Promise.reject(new Error('invalid config'));
View yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
acorn-globals@^1.0.3:
version "1.0.9"
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf"
dependencies:
acorn "^2.1.0"
View README.md
View pbpaste-html.js
var $ = require('nodobjc');
$.framework('AppKit');
function getNSData(data) {
var byteBuffer = new Buffer(data('length'));
data('getBytes', byteBuffer, 'length', byteBuffer.length);
return byteBuffer;
}
var toHtmlOpts = $.NSDictionary(
View gist:72f0d9530166af3fea1a
/* @flow */
type T1 = {x : number};
type T2 = {y : number};
type T3 = T1 & T2;
function mergeAndDoStuff(t1 : T1, t2 : T2) : T3 {
const result = Object.assign({}, t1, t2);
console.log(result.info.toString()); // at one time, T1 contained info, but it was removed
return result;
}