]> git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/object/clear.js
85e463728550d0c0eaa8517c8e9dab59a061cb13
[rbdr/dotfiles] / atom / packages / vim-mode / node_modules / grim / node_modules / emissary / node_modules / es6-weak-map / node_modules / es5-ext / object / clear.js
1 'use strict';
2
3 var keys = require('./keys');
4
5 module.exports = function (obj) {
6 var error;
7 keys(obj).forEach(function (key) {
8 try {
9 delete this[key];
10 } catch (e) {
11 if (!error) error = e;
12 }
13 }, obj);
14 if (error !== undefined) throw error;
15 return obj;
16 };