Skip to content

Commit

Permalink
Reverting Reflect.ownKeys() to Object.keys() because it doesn't n…
Browse files Browse the repository at this point in the history
…eed symbols in the enumeration
  • Loading branch information
avoidwork committed Nov 6, 2017
1 parent a3da95d commit cf6eabf
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 20 deletions.
5 changes: 2 additions & 3 deletions lib/tiny-lru.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"use strict";

(function (global) {
const next = typeof process !== "undefined" ? process.nextTick : arg => setTimeout(arg, 1),
keys = typeof Reflect !== "undefined" ? Reflect.ownKeys : Object.keys;
const next = typeof process !== "undefined" ? process.nextTick : arg => setTimeout(arg, 1);

class LRU {
constructor (max) {
Expand Down Expand Up @@ -174,7 +173,7 @@
update (arg) {
const obj = JSON.parse(arg);

keys(obj).forEach(i => {
Object.keys(obj).forEach(i => {
this[i] = obj[i];
});
}
Expand Down
5 changes: 2 additions & 3 deletions lib/tiny-lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
(function (global) {
var next = typeof process !== "undefined" ? process.nextTick : function (arg) {
return setTimeout(arg, 1);
},
keys = typeof Reflect !== "undefined" ? Reflect.ownKeys : Object.keys;
};

var LRU = function () {
function LRU(max) {
Expand Down Expand Up @@ -203,7 +202,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

var obj = JSON.parse(arg);

keys(obj).forEach(function (i) {
Object.keys(obj).forEach(function (i) {
_this[i] = obj[i];
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tiny-lru.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tiny-lru.min.js.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/intro.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use strict";

(function (global) {
const next = typeof process !== "undefined" ? process.nextTick : arg => setTimeout(arg, 1),
keys = typeof Reflect !== "undefined" ? Reflect.ownKeys : Object.keys;
const next = typeof process !== "undefined" ? process.nextTick : arg => setTimeout(arg, 1);
2 changes: 1 addition & 1 deletion src/lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
update (arg) {
const obj = JSON.parse(arg);

keys(obj).forEach(i => {
Object.keys(obj).forEach(i => {
this[i] = obj[i];
});
}
Expand Down

0 comments on commit cf6eabf

Please sign in to comment.