Skip to content

Commit

Permalink
Made es2015-loose for IE support
Browse files Browse the repository at this point in the history
  • Loading branch information
juspears committed Apr 4, 2016
1 parent 5ee9236 commit 99bf7a4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"presets": [
"react",
"es2015",
"es2015-loose",
"stage-0"
],
"plugins":[]
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"expect": "^1.13.4",
Expand Down
32 changes: 26 additions & 6 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ function keyIn(key, ...args) {
}
function onlyKeys(keys, ...args) {
const ret = {};
KEYS: for (let key of keys) {
ARGS: for (let arg of args) {
if (arg == null) continue ARGS;
let break_key = false;
for (let key of keys) {
for (let arg of args) {
if (arg == null) continue;
if (key in arg) {
ret[key] = arg[key];
continue KEYS;
break_key = true;
break;
}
}
if (break_key) {
break;
}
}

return ret;
Expand Down Expand Up @@ -66,7 +71,7 @@ function didMount() {

function listener(key, fn) {
function listener$listen(props, context) {
if (!this.injected){
if (!this.injected) {
this.injected = {};
}
if (!this._listeners) {
Expand Down Expand Up @@ -128,4 +133,19 @@ function unmount(fn) {
this.prototype.componentWillUnmount = applyNice(fn, this.prototype.componentWillUnmount);
}

export {applyNice,listener, extend, prop, unmount, extendStatic, extendPrototype, onlyKeys, keyIn, uniqueKeys, execArg, push, removeListeners, clearListeners}
export {
applyNice,
listener,
extend,
prop,
unmount,
extendStatic,
extendPrototype,
onlyKeys,
keyIn,
uniqueKeys,
execArg,
push,
removeListeners,
clearListeners
}

0 comments on commit 99bf7a4

Please sign in to comment.