summaryrefslogtreecommitdiffstats
path: root/addon-sdk/source/test/fixtures/loader
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /addon-sdk/source/test/fixtures/loader
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'addon-sdk/source/test/fixtures/loader')
-rw-r--r--addon-sdk/source/test/fixtures/loader/cycles/a.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/cycles/b.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/cycles/c.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/cycles/main.js14
-rw-r--r--addon-sdk/source/test/fixtures/loader/errors/boomer.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/errors/main.js9
-rw-r--r--addon-sdk/source/test/fixtures/loader/exceptions/boomer.js9
-rw-r--r--addon-sdk/source/test/fixtures/loader/exceptions/main.js11
-rw-r--r--addon-sdk/source/test/fixtures/loader/globals/main.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/invalid.json3
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/manifest.json14
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/mutation.json1
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/nodotjson.json.js8
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/test.json3
-rw-r--r--addon-sdk/source/test/fixtures/loader/json/test.json.js7
-rw-r--r--addon-sdk/source/test/fixtures/loader/lazy/main.js9
-rw-r--r--addon-sdk/source/test/fixtures/loader/missing-twice/file.json1
-rw-r--r--addon-sdk/source/test/fixtures/loader/missing-twice/main.js32
-rw-r--r--addon-sdk/source/test/fixtures/loader/missing/main.js10
-rw-r--r--addon-sdk/source/test/fixtures/loader/self/main.js8
-rw-r--r--addon-sdk/source/test/fixtures/loader/syntax-error/error.js11
-rw-r--r--addon-sdk/source/test/fixtures/loader/syntax-error/main.js10
-rw-r--r--addon-sdk/source/test/fixtures/loader/unsupported/fennec.js10
-rw-r--r--addon-sdk/source/test/fixtures/loader/unsupported/firefox.js10
24 files changed, 215 insertions, 0 deletions
diff --git a/addon-sdk/source/test/fixtures/loader/cycles/a.js b/addon-sdk/source/test/fixtures/loader/cycles/a.js
new file mode 100644
index 000000000..f6e13ccb7
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/cycles/a.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+exports.b = require('b');
diff --git a/addon-sdk/source/test/fixtures/loader/cycles/b.js b/addon-sdk/source/test/fixtures/loader/cycles/b.js
new file mode 100644
index 000000000..69e23f11a
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/cycles/b.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+exports.a = require('a');
diff --git a/addon-sdk/source/test/fixtures/loader/cycles/c.js b/addon-sdk/source/test/fixtures/loader/cycles/c.js
new file mode 100644
index 000000000..ce34b3cf4
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/cycles/c.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+exports.main = require('main');
diff --git a/addon-sdk/source/test/fixtures/loader/cycles/main.js b/addon-sdk/source/test/fixtures/loader/cycles/main.js
new file mode 100644
index 000000000..6d13200c8
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/cycles/main.js
@@ -0,0 +1,14 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+var a = require('a');
+var b = require('b');
+var c = require('c');
+
+exports.a = a;
+exports.b = b;
+exports.c = c;
+exports.main = exports;
diff --git a/addon-sdk/source/test/fixtures/loader/errors/boomer.js b/addon-sdk/source/test/fixtures/loader/errors/boomer.js
new file mode 100644
index 000000000..c794cda33
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/errors/boomer.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+throw Error("opening input stream (invalid filename?)");
diff --git a/addon-sdk/source/test/fixtures/loader/errors/main.js b/addon-sdk/source/test/fixtures/loader/errors/main.js
new file mode 100644
index 000000000..1fdb56790
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/errors/main.js
@@ -0,0 +1,9 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+var error = require('./boomer');
+
+exports.main = exports;
diff --git a/addon-sdk/source/test/fixtures/loader/exceptions/boomer.js b/addon-sdk/source/test/fixtures/loader/exceptions/boomer.js
new file mode 100644
index 000000000..e26817984
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/exceptions/boomer.js
@@ -0,0 +1,9 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+exports.boom = function() {
+ throw Error("Boom!");
+};
diff --git a/addon-sdk/source/test/fixtures/loader/exceptions/main.js b/addon-sdk/source/test/fixtures/loader/exceptions/main.js
new file mode 100644
index 000000000..4b6279d7d
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/exceptions/main.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+var boomer = require('./boomer');
+
+boomer.boom();
+
+exports.main = exports;
diff --git a/addon-sdk/source/test/fixtures/loader/globals/main.js b/addon-sdk/source/test/fixtures/loader/globals/main.js
new file mode 100644
index 000000000..6d34ddbd3
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/globals/main.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+exports.console = console;
+exports.globalFoo = (typeof globalFoo !== "undefined") ? globalFoo : null;
diff --git a/addon-sdk/source/test/fixtures/loader/json/invalid.json b/addon-sdk/source/test/fixtures/loader/json/invalid.json
new file mode 100644
index 000000000..02ea4b0b4
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/invalid.json
@@ -0,0 +1,3 @@
+{
+ invalidjson
+}
diff --git a/addon-sdk/source/test/fixtures/loader/json/manifest.json b/addon-sdk/source/test/fixtures/loader/json/manifest.json
new file mode 100644
index 000000000..5ae25bb9d
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/manifest.json
@@ -0,0 +1,14 @@
+{
+ "name": "Jetpack Loader Test",
+ "version": "1.0.1",
+ "dependencies": {
+ "async": "*",
+ "underscore": "*"
+ },
+ "contributors": [
+ "ash nazg durbatulûk",
+ "ash nazg gimbatul",
+ "ash nazg thrakatulûk",
+ "agh burzum-ishi krimpatul"
+ ]
+}
diff --git a/addon-sdk/source/test/fixtures/loader/json/mutation.json b/addon-sdk/source/test/fixtures/loader/json/mutation.json
new file mode 100644
index 000000000..e1cbe3c15
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/mutation.json
@@ -0,0 +1 @@
+{ "value": 1 }
diff --git a/addon-sdk/source/test/fixtures/loader/json/nodotjson.json.js b/addon-sdk/source/test/fixtures/loader/json/nodotjson.json.js
new file mode 100644
index 000000000..af046caa6
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/nodotjson.json.js
@@ -0,0 +1,8 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+module.exports = {
+ "filename": "nodotjson.json.js",
+ "data": {}
+};
diff --git a/addon-sdk/source/test/fixtures/loader/json/test.json b/addon-sdk/source/test/fixtures/loader/json/test.json
new file mode 100644
index 000000000..d19dc7117
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/test.json
@@ -0,0 +1,3 @@
+{
+ "filename": "test.json"
+}
diff --git a/addon-sdk/source/test/fixtures/loader/json/test.json.js b/addon-sdk/source/test/fixtures/loader/json/test.json.js
new file mode 100644
index 000000000..b14364bff
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/json/test.json.js
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+module.exports = {
+ "filename": "test.json.js"
+};
diff --git a/addon-sdk/source/test/fixtures/loader/lazy/main.js b/addon-sdk/source/test/fixtures/loader/lazy/main.js
new file mode 100644
index 000000000..04525f972
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/lazy/main.js
@@ -0,0 +1,9 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+exports.useFoo= function () {
+ return require('foo');
+}
diff --git a/addon-sdk/source/test/fixtures/loader/missing-twice/file.json b/addon-sdk/source/test/fixtures/loader/missing-twice/file.json
new file mode 100644
index 000000000..ebd6f791b
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/missing-twice/file.json
@@ -0,0 +1 @@
+an invalid json file
diff --git a/addon-sdk/source/test/fixtures/loader/missing-twice/main.js b/addon-sdk/source/test/fixtures/loader/missing-twice/main.js
new file mode 100644
index 000000000..20e453736
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/missing-twice/main.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+try {
+ require('./not-found');
+}
+catch (e1) {
+ exports.firstError = e1;
+ // It should throw again and not be cached
+ try {
+ require('./not-found');
+ }
+ catch (e2) {
+ exports.secondError = e2;
+ }
+}
+
+try {
+ require('./file.json');
+}
+catch (e) {
+ exports.invalidJSON1 = e;
+ try {
+ require('./file.json');
+ }
+ catch (e) {
+ exports.invalidJSON2 = e;
+ }
+}
diff --git a/addon-sdk/source/test/fixtures/loader/missing/main.js b/addon-sdk/source/test/fixtures/loader/missing/main.js
new file mode 100644
index 000000000..dde9ee77c
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/missing/main.js
@@ -0,0 +1,10 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+var a = require('./not-found');
+
+exports.a = a;
+exports.main = exports;
diff --git a/addon-sdk/source/test/fixtures/loader/self/main.js b/addon-sdk/source/test/fixtures/loader/self/main.js
new file mode 100644
index 000000000..ab2b159da
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/self/main.js
@@ -0,0 +1,8 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+var self = require("sdk/self");
+exports.self = self;
diff --git a/addon-sdk/source/test/fixtures/loader/syntax-error/error.js b/addon-sdk/source/test/fixtures/loader/syntax-error/error.js
new file mode 100644
index 000000000..56c7c524f
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/syntax-error/error.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+module.metadata = {
+ "status": "experimental"
+};
+
+exports.b = @ require('b');
diff --git a/addon-sdk/source/test/fixtures/loader/syntax-error/main.js b/addon-sdk/source/test/fixtures/loader/syntax-error/main.js
new file mode 100644
index 000000000..4eadef870
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/syntax-error/main.js
@@ -0,0 +1,10 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+'use strict';
+
+var a = require('./error');
+
+exports.a = a;
+exports.main = exports;
diff --git a/addon-sdk/source/test/fixtures/loader/unsupported/fennec.js b/addon-sdk/source/test/fixtures/loader/unsupported/fennec.js
new file mode 100644
index 000000000..9edc63c14
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/unsupported/fennec.js
@@ -0,0 +1,10 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+module.metadata = {
+ "engines": {
+ "Fennec": "*"
+ }
+};
+module.exports = {};
diff --git a/addon-sdk/source/test/fixtures/loader/unsupported/firefox.js b/addon-sdk/source/test/fixtures/loader/unsupported/firefox.js
new file mode 100644
index 000000000..5a08280a4
--- /dev/null
+++ b/addon-sdk/source/test/fixtures/loader/unsupported/firefox.js
@@ -0,0 +1,10 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+module.metadata = {
+ "engines": {
+ "Firefox": "*"
+ }
+};
+module.exports = {};