]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/src/third_party/duktape-1.3.0/polyfills/console-minimal.js
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / civetweb / src / third_party / duktape-1.3.0 / polyfills / console-minimal.js
1 /*
2 * Minimal console.log() polyfill
3 */
4
5 if (typeof console === 'undefined') {
6 Object.defineProperty(this, 'console', {
7 value: {}, writable: true, enumerable: false, configurable: true
8 });
9 }
10 if (typeof console.log === 'undefined') {
11 (function () {
12 var origPrint = print; // capture in closure in case changed later
13 Object.defineProperty(this.console, 'log', {
14 value: function () {
15 var strArgs = Array.prototype.map.call(arguments, function (v) { return String(v); });
16 origPrint(Array.prototype.join.call(strArgs, ' '));
17 }, writable: true, enumerable: false, configurable: true
18 });
19 })();
20 }