Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support cloning of es6 Maps #60

Closed
omerts opened this issue Jun 1, 2016 · 2 comments
Closed

Feature: Support cloning of es6 Maps #60

omerts opened this issue Jun 1, 2016 · 2 comments
Assignees

Comments

@omerts
Copy link

omerts commented Jun 1, 2016

Currently when trying to clone an ES2015 Map object, I get an empty object returned.

@pvorb
Copy link
Owner

pvorb commented Jul 26, 2016

What platform are you using? Which browser/Node.js version? Browserify, Webpack, etc.?

@pvorb pvorb self-assigned this Jul 26, 2016
@tristanls
Copy link

I'm not sure if this is the correct place to put this, but lack of support for Maps breaks clone in newest Node.js.

$ node -v
v6.5.0
$ node
> const clone = require("clone");
undefined
> const map = new Map();
undefined
> map.set("key", "value");
Map { 'key' => 'value' }
> map.has("key");
true
> const clonedMap = clone(map)
undefined
> clonedMap.has("key");
TypeError: Method Map.prototype.has called on incompatible receiver #<Map>
    at Map.has (native)
    at repl:1:11
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:313:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:504:10)
    at emitOne (events.js:101:20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants