http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt new file mode 100644 index 0000000..54a1cd7 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt @@ -0,0 +1,2 @@ +CommonJS specification snapshots are included in the references/ +directory. CommonJS is under the MIT license: http://www.commonjs.org/.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt new file mode 100644 index 0000000..24e65f1 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt @@ -0,0 +1 @@ +Lua is under the MIT license: http://www.lua.org/license.html. http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt new file mode 100644 index 0000000..7029925 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js new file mode 100644 index 0000000..79b5195 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js @@ -0,0 +1,53 @@ +/* + * Mandelbrot example: + * + * $ ./duk mandel.js + * [...] + */ + +function mandel() { + var w = 76, h = 28, iter = 100; + var i, j, k, c; + var x0, y0, xx, yy, xx2, yy2; + var line; + + for (i = 0; i < h; i++) { + y0 = (i / h) * 2.5 - 1.25; + + for (j = 0, line = []; j < w; j++) { + x0 = (j / w) * 3.0 - 2.0; + + for (k = 0, xx = 0, yy = 0, c = '#'; k < iter; k++) { + /* z -> z^2 + c + * -> (xx+i*yy)^2 + (x0+i*y0) + * -> xx*xx+i*2*xx*yy-yy*yy + x0 + i*y0 + * -> (xx*xx - yy*yy + x0) + i*(2*xx*yy + y0) + */ + + xx2 = xx*xx; yy2 = yy*yy; + + if (xx2 + yy2 < 4.0) { + yy = 2*xx*yy + y0; + xx = xx2 - yy2 + x0; + } else { + /* xx^2 + yy^2 >= 4.0 */ + if (k < 3) { c = '.'; } + else if (k < 5) { c = ','; } + else if (k < 10) { c = '-'; } + else { c = '='; } + break; + } + } + + line.push(c); + } + + print(line.join('')); + } +} + +try { + mandel(); +} catch (e) { + print(e.stack || e); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/console-minimal.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/console-minimal.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/console-minimal.js new file mode 100644 index 0000000..1876c5f --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/console-minimal.js @@ -0,0 +1,20 @@ +/* + * Minimal console.log() polyfill + */ + +if (typeof console === 'undefined') { + Object.defineProperty(this, 'console', { + value: {}, writable: true, enumerable: false, configurable: true + }); +} +if (typeof console.log === 'undefined') { + (function () { + var origPrint = print; // capture in closure in case changed later + Object.defineProperty(this.console, 'log', { + value: function () { + var strArgs = Array.prototype.map.call(arguments, function (v) { return String(v); }); + origPrint(Array.prototype.join.call(strArgs, ' ')); + }, writable: true, enumerable: false, configurable: true + }); + })(); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-nonwritable.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-nonwritable.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-nonwritable.js new file mode 100644 index 0000000..236c706 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-nonwritable.js @@ -0,0 +1,20 @@ +/* + * Ensure Error .fileName, .lineNumber, and .stack are not directly writable, + * but can be written using Object.defineProperty(). This matches Duktape + * 1.3.0 and prior. + * + * See: https://github.com/svaarala/duktape/pull/390. + */ + +(function () { + var err = new Error('test'); + err.fileName = 999; + if (err.fileName !== 999) { return; } // already non-writable + + var fn = new Function(''); // nop + Object.defineProperties(Error.prototype, { + fileName: { set: fn }, + lineNumber: { set: fn }, + stack: { set: fn } + }); +})(); http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-writable.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-writable.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-writable.js new file mode 100644 index 0000000..5d487cd --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-error-setter-writable.js @@ -0,0 +1,19 @@ +/* + * Ensure Error .fileName, .lineNumber, and .stack are directly writable + * without having to use Object.defineProperty(). This matches Duktape + * 1.4.0 behavior. + * + * See: https://github.com/svaarala/duktape/pull/390. + */ + +(function () { + var err = new Error('test'); + err.fileName = 999; + if (err.fileName === 999) { return; } // already writable + + Object.defineProperties(Error.prototype, { + fileName: { set: new Function('v', 'Object.defineProperty(this, "fileName", { value: v, writable: true, enumerable: false, configurable: true });') }, + lineNumber: { set: new Function('v', 'Object.defineProperty(this, "lineNumber", { value: v, writable: true, enumerable: false, configurable: true });') }, + stack: { set: new Function('v', 'Object.defineProperty(this, "stack", { value: v, writable: true, enumerable: false, configurable: true });') }, + }); +})(); http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-isfastint.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-isfastint.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-isfastint.js new file mode 100644 index 0000000..68219e4 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/duktape-isfastint.js @@ -0,0 +1,38 @@ +/* + * Helper to check if a number is internally represented as a fastint: + * + * if (Duktape.isFastint(x)) { + * print('fastint'); + * } else { + * print('not a fastint (or not a number)'); + * } + * + * NOTE: This helper depends on the internal tag numbering (defined in + * duk_tval.h) which is both version specific and depends on whether + * duk_tval is packed or not. + */ + +if (typeof Duktape === 'object') { + if (typeof Duktape.fastintTag === 'undefined') { + Object.defineProperty(Duktape, 'fastintTag', { + /* Tag number depends on duk_tval packing. */ + value: (Duktape.info(true)[1] >= 0xfff0) ? + 0xfff1 /* tag for packed duk_tval */ : + 1 /* tag for unpacked duk_tval */, + writable: false, + enumerable: false, + configurable: true + }); + } + if (typeof Duktape.isFastint === 'undefined') { + Object.defineProperty(Duktape, 'isFastint', { + value: function (v) { + return Duktape.info(v)[0] === 4 && /* public type is DUK_TYPE_NUMBER */ + Duktape.info(v)[1] === Duktape.fastintTag; /* internal tag is fastint */ + }, + writable: false, + enumerable: false, + configurable: true + }); + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-assign.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-assign.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-assign.js new file mode 100644 index 0000000..dfa5a44 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-assign.js @@ -0,0 +1,45 @@ +/* + * Object.assign(), described in E6 Section 19.1.2.1 + * + * http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.assign + */ + +if (typeof Object.assign === 'undefined') { + Object.defineProperty(Object, 'assign', { + value: function (target) { + var i, n, j, m, k; + var source, keys; + var gotError; + var pendingError; + + if (target == null) { + throw new Exception('target null or undefined'); + } + + for (i = 1, n = arguments.length; i < n; i++) { + source = arguments[i]; + if (source == null) { + continue; // null or undefined + } + source = Object(source); + keys = Object.keys(source); // enumerable own keys + + for (j = 0, m = keys.length; j < m; j++) { + k = keys[j]; + try { + target[k] = source[k]; + } catch (e) { + if (!gotError) { + gotError = true; + pendingError = e; + } + } + } + } + + if (gotError) { + throw pendingError; + } + }, writable: true, enumerable: false, configurable: true + }); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definegetter.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definegetter.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definegetter.js new file mode 100644 index 0000000..8d8cabb --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definegetter.js @@ -0,0 +1,11 @@ +/* + * Object.prototype.__defineGetter__ polyfill + */ + +if (typeof Object.prototype.__defineGetter__ === 'undefined') { + Object.defineProperty(Object.prototype, '__defineGetter__', { + value: function (n, f) { + Object.defineProperty(this, n, { enumerable: true, configurable: true, get: f }); + }, writable: true, enumerable: false, configurable: true + }); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definesetter.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definesetter.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definesetter.js new file mode 100644 index 0000000..6bd1722 --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/object-prototype-definesetter.js @@ -0,0 +1,11 @@ +/* + * Object.prototype.__defineSetter__ polyfill + */ + +if (typeof Object.prototype.__defineSetter__ === 'undefined') { + Object.defineProperty(Object.prototype, '__defineSetter__', { + value: function (n, f) { + Object.defineProperty(this, n, { enumerable: true, configurable: true, set: f }); + }, writable: true, enumerable: false, configurable: true + }); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/performance-now.js ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/performance-now.js b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/performance-now.js new file mode 100644 index 0000000..dfb0a1d --- /dev/null +++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/performance-now.js @@ -0,0 +1,25 @@ +/* + * Performance.now() polyfill + * + * http://www.w3.org/TR/hr-time/#sec-high-resolution-time + * + * Dummy implementation which uses the Date built-in and has no higher + * resolution. If/when Duktape has a built-in high resolution timer + * interface, reimplement this. + */ + +var _perfNowZeroTime = Date.now(); + +if (typeof Performance === 'undefined') { + Object.defineProperty(this, 'Performance', { + value: {}, + writable: true, enumerable: false, configurable: true + }); +} +if (typeof Performance.now === 'undefined') { + Object.defineProperty(Performance, 'now', { + value: function () { + return Date.now() - _perfNowZeroTime; + }, writable: true, enumerable: false, configurable: true + }); +}