-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
57 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,5 @@ node_modules | |
.node_repl_history | ||
|
||
.DS_Store | ||
lib | ||
dist | ||
|
||
.nyc_output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- 5.10.1 | ||
|
||
compiler: clang-3.6 | ||
|
||
env: | ||
- CXX=clang-3.6 | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- llvm-toolchain-precise-3.6 | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- clang-3.6 | ||
- g++-4.8 | ||
|
||
after_success: npm run coveralls |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# trivial-js-interpreter | ||
# The Super Tiny _Interpreter_ | ||
Let's explain what a **closure** is by writing a JavaScript interpreter in JavaScript. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
{ | ||
"name": "trivial-js-interpreter", | ||
"name": "the-super-tiny-interpreter", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"description": "Explain what a closure is by writing a JavaScript interpreter in JavaScript", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"clean": "rimraf lib coverage", | ||
"build:babel": "babel src --out-dir lib --ignore __tests__", | ||
"test": "jest", | ||
"lint": "eslint src" | ||
"coverage": "jest --coverage", | ||
"coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls", | ||
"lint": "eslint src", | ||
"postinstall": "npm run clean && npm run lint && npm test && npm run coveralls && npm run build:babel" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/keyanzhang/trivial-js-interpreter.git" | ||
"url": "git+https://github.com/keyanzhang/the-super-tiny-interpreter.git" | ||
}, | ||
"keywords": [], | ||
"author": "Keyan Zhang <[email protected]> (http:https://keya.nz)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/keyanzhang/trivial-js-interpreter/issues" | ||
"url": "https://github.com/keyanzhang/the-super-tiny-interpreter/issues" | ||
}, | ||
"homepage": "https://github.com/keyanzhang/trivial-js-interpreter#readme", | ||
"homepage": "https://github.com/keyanzhang/the-super-tiny-interpreter#readme", | ||
"devDependencies": { | ||
"babel-cli": "^6.7.5", | ||
"babel-core": "^6.7.6", | ||
"babel-eslint": "^6.0.2", | ||
"babel-jest": "^11.0.0", | ||
"babel-jest": "^11.0.1", | ||
"babel-plugin-transform-flow-strip-types": "^6.7.0", | ||
"babel-polyfill": "^6.7.4", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"eslint": "^2.7.0", | ||
"coveralls": "^2.11.9", | ||
"eslint": "^2.8.0", | ||
"eslint-config-airbnb": "^7.0.0", | ||
"eslint-plugin-babel": "^3.2.0", | ||
"jest": "^0.1.40", | ||
|
@@ -35,14 +42,17 @@ | |
"dependencies": { | ||
"babylon": "^6.7.0", | ||
"fbjs": "^0.8.0", | ||
"immutable": "^3.7.6" | ||
"immutable": "^3.8.0" | ||
}, | ||
"jest": { | ||
"unmockedModulePathPatterns": [ | ||
"<rootDir>/node_modules/babylon", | ||
"<rootDir>/node_modules/immutable", | ||
"<rootDir>/node_modules/fbjs", | ||
"<rootDir>/src/utils" | ||
], | ||
"testPathDirs": [ | ||
"<rootDir>/src" | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const adder = (x) => (y) => x + y; | ||
const add3 = adder(3); | ||
add3(39); | ||
(() => { | ||
const adder = (x) => (y) => x + y; | ||
const add3 = adder(3); | ||
return add3(39); | ||
})(); |
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
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
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
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