Mercurial > psgxs
comparison storage.js @ 5:d8a98540d749
Reimport nodes methods when loading from file.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 29 Jun 2010 23:29:29 +0200 |
parents | c2954a9e5665 |
children | 2bcadb0531f4 |
comparison
equal
deleted
inserted
replaced
4:4c93e76fa371 | 5:d8a98540d749 |
---|---|
540 file = 'save.json'; | 540 file = 'save.json'; |
541 | 541 |
542 var data = fs.readFileSync(file); | 542 var data = fs.readFileSync(file); |
543 var obj = eval('('+data+')'); | 543 var obj = eval('('+data+')'); |
544 list = endParsing(obj); | 544 list = endParsing(obj); |
545 | |
546 for (var i in list) | |
547 for (var j in Node.prototype) | |
548 list[i][j] = Node.prototype[j]; | |
545 } | 549 } |
546 | 550 |
547 storage.debug = function() { | 551 storage.debug = function() { |
548 sys.puts('\033[1;33m' + sys.inspect(list, null, null) + '\033[0m'); | 552 sys.puts('\033[1;33m' + sys.inspect(list, null, null) + '\033[0m'); |
549 }; | 553 }; |