Changeset 2103 for lang/javascript/Object.toSource
- Timestamp:
- 11/28/07 14:32:13 (12 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/Object.toSource/lib/Object/toSource.js
r1782 r2103 12 12 if (typeof this == 'function' || this instanceof Function) { 13 13 var r = this.toString(); 14 r = r.replace(/function\(/, 'function \(').replace(/\)\{/, ') {'); 15 return '(' + r + ')'; 14 return r.replace(/function\(/, 'function \(').replace(/\)\{/, ') {'); 16 15 } 17 16 … … 24 23 r.push('null'); 25 24 } else { 26 r.push(t his[i].toSource());25 r.push(toSource.apply(this[i])); 27 26 } 28 27 } … … 59 58 60 59 if (!(this instanceof Array) && this instanceof Object) { 61 return '(' + toSource () + ')';60 return '(' + toSource.apply(this) + ')'; 62 61 } 63 return toSource(); 62 63 return toSource.apply(this); 64 64 }; 65 65 66 66 Object.prototype.toSource = toSourceFirst; 67 67 })() 68 69 Object.prototype.toSource.VERSION = '0.0.1'; 68 70 69 71 /*
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)