(base, props)
| 6969 | if ([].map) map = function(array, f) { return array.map(f); }; |
| 6970 | |
| 6971 | function createObj(base, props) { |
| 6972 | var inst; |
| 6973 | if (Object.create) { |
| 6974 | inst = Object.create(base); |
| 6975 | } else { |
| 6976 | var ctor = function() {}; |
| 6977 | ctor.prototype = base; |
| 6978 | inst = new ctor(); |
| 6979 | } |
| 6980 | if (props) copyObj(props, inst); |
| 6981 | return inst; |
| 6982 | }; |
| 6983 | |
| 6984 | function copyObj(obj, target, overwrite) { |
| 6985 | if (!target) target = {}; |