Commit 03d6e2c7 authored by Morgân von Brylân's avatar Morgân von Brylân

Corrigé la fonction clone pour qu'elle soit standart (__proto__ étant déprécié).

parent 0f35568c
/********** util.js - version Node.js 2.6 ***********/
/********** util.js - version Node.js 2.7 ***********/
/* Contents :
......@@ -50,9 +49,8 @@ module.exports = {
if (obj === null || typeof obj !== 'object')
return obj;
//var temp = obj.constructor(); // give temp the original obj's constructor // marche pas
var temp = {};
temp.__proto__ = obj.__proto__;
var temp = new obj.constructor();
for (var key in obj)
temp[key] = this.clone(obj[key]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment