summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/examples/sourcemaps3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /devtools/client/debugger/test/mochitest/examples/sourcemaps3
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/test/mochitest/examples/sourcemaps3')
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/.babelrc1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/.gitignore2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/README.md4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/package.json19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/sorted.js43
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/test.js7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/webpack.config.js31
9 files changed, 110 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.babelrc b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.babelrc
new file mode 100644
index 0000000000..01fd19076e
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.babelrc
@@ -0,0 +1 @@
+ { "presets": [ "es2015" ] }
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.gitignore b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.gitignore
new file mode 100644
index 0000000000..504afef81f
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/.gitignore
@@ -0,0 +1,2 @@
+node_modules/
+package-lock.json
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/README.md b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/README.md
new file mode 100644
index 0000000000..71933217b0
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/README.md
@@ -0,0 +1,4 @@
+How to update?
+
+$ yarn
+$ yarn run webpack
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js
new file mode 100644
index 0000000000..a16c05500d
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js
@@ -0,0 +1,2 @@
+!function(n){function e(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};e.m=n,e.c=r,e.d=function(n,r,t){e.o(n,r)||Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:t})},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=0)}([function(n,e,r){"use strict";var t=r(1);window.test=function(){var n=["b (30)","a","b (5)","z"],e=(0,t.fancySort)(n);console.log(e)}},function(n,e,r){"use strict";function t(n,e){var r=/.(\d+)\W*$/.exec(n),t=/.(\d+)\W*$/.exec(e);if(null==r||null==t||r[1]==t[1])return n<e?-1:n>e?1:0;var o=+r[1],u=+t[1];return o<u?-1:o>u?1:0}function o(n,e,r){if(0==n.length)return{found:!1,index:0};for(var t=0,o=n.length-1;t<o;){var u=Math.floor((t+o)/2);r(n[u],e)<0?t=u+1:o=u}var c=r(n[t],e);return 0===c?{found:!0,index:t}:{found:!1,index:c<0?t+1:t}}function u(n){return n.reduce(function(n,e){var r=o(n,e,t),u=r.index;return n.splice(u,0,e),n},[])}Object.defineProperty(e,"__esModule",{value:!0}),e.fancySort=u}]);
+//# sourceMappingURL=bundle.js.map \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js.map b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js.map
new file mode 100644
index 0000000000..1769f67f7d
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///bundle.js","webpack:///webpack/bootstrap 24c582683c5b4b6a8192","webpack:///./test.js","webpack:///./sorted.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","window","test","result","fancySort","console","log","comparer","a","b","ma","exec","mb","na","nb","binaryLookup","ar","length","found","index","r","mid","Math","floor","input","reduce","splice","value"],"mappings":"CAAS,SAAUA,GCIjB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BI,EAAGJ,EACHK,GAAG,EACHH,WAUD,OANAJ,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,GAAID,KA4BJF,GAAoBQ,EAAIT,EAGxBC,EAAoBS,EAAIP,EAGxBF,EAAoBU,EAAI,SAASP,EAASQ,EAAMC,GAC3CZ,EAAoBa,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,GAC9BK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRZ,EAAoBmB,EAAI,SAASf,GAChC,GAAIQ,GAASR,GAAUA,EAAOgB,WAC7B,WAAwB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GAAM,MACXoC,EAAaC,EAAIrC,EAAG4B,GAA9BY,EADqB,EACrBA,KAER,OADAH,GAAGU,OAAOP,EAAO,EAAGxC,GACbqC,OH+CX5B,OAAOC,eAAeZ,EAAS,cAC7BkD,OAAO,IAETlD,EGtDgB2B","file":"bundle.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _sorted = __webpack_require__(1);\n\nwindow.test = function originalTestName() {\n var test = [\"b (30)\", \"a\", \"b (5)\", \"z\"];\n var result = (0, _sorted.fancySort)(test);\n console.log(result);\n};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.fancySort = fancySort;\nfunction comparer(a, b) {\n var ma = /.(\\d+)\\W*$/.exec(a);\n var mb = /.(\\d+)\\W*$/.exec(b);\n if (ma == null || mb == null || ma[1] == mb[1]) {\n return a < b ? -1 : a > b ? 1 : 0;\n } else {\n var na = +ma[1],\n nb = +mb[1];\n return na < nb ? -1 : na > nb ? 1 : 0;\n }\n}\n\nfunction binaryLookup(ar, i, comparer) {\n if (ar.length == 0) {\n return { found: false, index: 0 };\n }\n var l = 0,\n r = ar.length - 1;\n while (l < r) {\n var mid = Math.floor((l + r) / 2);\n if (comparer(ar[mid], i) < 0) {\n l = mid + 1;\n } else {\n r = mid;\n }\n }\n var result = comparer(ar[l], i);\n if (result === 0) {\n return { found: true, index: l };\n }\n return {\n found: false,\n index: result < 0 ? l + 1 : l\n };\n}\n\nfunction fancySort(input) {\n return input.reduce(function (ar, i) {\n var _binaryLookup = binaryLookup(ar, i, comparer),\n index = _binaryLookup.index;\n\n ar.splice(index, 0, i);\n return ar;\n }, []);\n}\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// bundle.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 24c582683c5b4b6a8192","import { fancySort } from \"./sorted.js\";\n\nwindow.test = function originalTestName() {\n let test = [\"b (30)\", \"a\", \"b (5)\", \"z\"];\n let result = fancySort(test);\n console.log(result);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./test.js","function comparer(a, b) {\n const ma = /.(\\d+)\\W*$/.exec(a);\n const mb = /.(\\d+)\\W*$/.exec(b);\n if (ma == null || mb == null || ma[1] == mb[1]) {\n return a < b ? -1 : a > b ? 1 : 0;\n } else {\n const na = +ma[1],\n nb = +mb[1];\n return na < nb ? -1 : na > nb ? 1 : 0;\n }\n}\n\nfunction binaryLookup(ar, i, comparer) {\n if (ar.length == 0) {\n return { found: false, index: 0 };\n }\n let l = 0,\n r = ar.length - 1;\n while (l < r) {\n const mid = Math.floor((l + r) / 2);\n if (comparer(ar[mid], i) < 0) {\n l = mid + 1;\n } else {\n r = mid;\n }\n }\n const result = comparer(ar[l], i);\n if (result === 0) {\n return { found: true, index: l };\n }\n return {\n found: false,\n index: result < 0 ? l + 1 : l\n };\n}\n\nexport function fancySort(input) {\n return input.reduce((ar, i) => {\n const { index } = binaryLookup(ar, i, comparer);\n ar.splice(index, 0, i);\n return ar;\n }, []);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./sorted.js"],"sourceRoot":""} \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/package.json b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/package.json
new file mode 100644
index 0000000000..0e2e2bf9fc
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "sorted-es6",
+ "version": "1.0.0",
+ "description": "Rebuild assets for sourcemaps3 test",
+ "main": "sorted.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "MPL-2.0",
+ "dependencies": {},
+ "devDependencies": {
+ "babel-core": "^6.26.0",
+ "babel-loader": "^7.1.2",
+ "babel-preset-es2015": "^6.24.1",
+ "webpack": "^3.7.1"
+ }
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/sorted.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/sorted.js
new file mode 100644
index 0000000000..2621b8f5a4
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/sorted.js
@@ -0,0 +1,43 @@
+function comparer(a, b) {
+ const ma = /.(\d+)\W*$/.exec(a);
+ const mb = /.(\d+)\W*$/.exec(b);
+ if (ma == null || mb == null || ma[1] == mb[1]) {
+ return a < b ? -1 : a > b ? 1 : 0;
+ } else {
+ const na = +ma[1],
+ nb = +mb[1];
+ return na < nb ? -1 : na > nb ? 1 : 0;
+ }
+}
+
+function binaryLookup(ar, i, comparer) {
+ if (ar.length == 0) {
+ return { found: false, index: 0 };
+ }
+ let l = 0,
+ r = ar.length - 1;
+ while (l < r) {
+ const mid = Math.floor((l + r) / 2);
+ if (comparer(ar[mid], i) < 0) {
+ l = mid + 1;
+ } else {
+ r = mid;
+ }
+ }
+ const result = comparer(ar[l], i);
+ if (result === 0) {
+ return { found: true, index: l };
+ }
+ return {
+ found: false,
+ index: result < 0 ? l + 1 : l
+ };
+}
+
+export function fancySort(input) {
+ return input.reduce((ar, i) => {
+ const { index } = binaryLookup(ar, i, comparer);
+ ar.splice(index, 0, i);
+ return ar;
+ }, []);
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/test.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/test.js
new file mode 100644
index 0000000000..13e80e583d
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/test.js
@@ -0,0 +1,7 @@
+import { fancySort } from "./sorted.js";
+
+window.test = function originalTestName() {
+ let test = ["b (30)", "a", "b (5)", "z"];
+ let result = fancySort(test);
+ console.log(result);
+};
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps3/webpack.config.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/webpack.config.js
new file mode 100644
index 0000000000..c4b5f486d1
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps3/webpack.config.js
@@ -0,0 +1,31 @@
+const path = require("path");
+const webpack = require("webpack");
+
+module.exports = {
+ entry: "./test.js",
+ output: {
+ path: __dirname,
+ filename: "bundle.js"
+ },
+ devtool: "sourcemap",
+ module: {
+ loaders: [
+ {
+ test: /\.js$/,
+ exclude: /node_modules/,
+ loader: "babel-loader"
+ }
+ ]
+ },
+ plugins: [
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ },
+ sourceMap: true,
+ output: {
+ comments: false
+ }
+ })
+ ]
+};