diff options
author | Graeme Yeates <yeatesgraeme@gmail.com> | 2016-02-15 18:15:31 -0500 |
---|---|---|
committer | Graeme Yeates <yeatesgraeme@gmail.com> | 2016-02-15 18:26:47 -0500 |
commit | 9688db38d9e7932601c219e5782fe99e1dbffc73 (patch) | |
tree | 7ab888949a7a6e27cf10f95b5e493d28f61e0dfe | |
parent | 636908bcf2806cc7f77cb8aec08f04ad08ead275 (diff) | |
download | async-9688db38d9e7932601c219e5782fe99e1dbffc73.tar.gz |
Skip failing test case
-rw-r--r-- | lib/memoize.js | 4 | ||||
-rwxr-xr-x | test/test-async.js | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/memoize.js b/lib/memoize.js index 963e031..30b989c 100644 --- a/lib/memoize.js +++ b/lib/memoize.js @@ -7,8 +7,8 @@ import has from 'lodash/has'; import setImmediate from './internal/setImmediate'; export default function memoize(fn, hasher) { - var memo = {}; - var queues = {}; + var memo = Object.create(null); + var queues = Object.create(null); hasher = hasher || identity; var memoized = rest(function memoized(args) { var callback = args.pop(); diff --git a/test/test-async.js b/test/test-async.js index 2b26b51..e27dd33 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -4296,6 +4296,14 @@ exports['memoize'] = { }, 'avoid __proto__ key return undefined': function (test) { + // Skip test if there is a Object.create bug (node 0.10 and some Chrome 30x versions) + var x = Object.create(null); + /* jshint proto: true */ + x.__proto__ = 'foo'; + if (x.__proto__ !== 'foo') { + return test.done(); + } + test.expect(1); var fn = async.memoize(function(name, callback) { setTimeout(function(){ |