Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 32bbb54

Browse files
committed
Remove references to Scratchpad.
As https://bugzilla.mozilla.org/show_bug.cgi\?id\=1519103 will land soon, we don't need to deal with Scratchpad anymore.
1 parent 7f085e5 commit 32bbb54

2 files changed

Lines changed: 0 additions & 33 deletions

File tree

packages/devtools-modules/src/source-utils.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,6 @@ function getSourceNames(source) {
134134
}
135135
}
136136

137-
// If Scratchpad URI, like "Scratchpad/1"; no modifications,
138-
// and short/long are the same.
139-
if (isScratchpadScheme(sourceStr)) {
140-
let result = { short: sourceStr, long: sourceStr };
141-
gSourceNamesStore.set(source, result);
142-
return result;
143-
}
144-
145137
const parsedUrl = parseURL(sourceStr);
146138

147139
if (!parsedUrl) {
@@ -192,23 +184,6 @@ function isColonSlashSlash(location, i = 0) {
192184
location.charCodeAt(++i) === CHAR_CODE_SLASH;
193185
}
194186

195-
/**
196-
* Checks for a Scratchpad URI, like "Scratchpad/1"
197-
*/
198-
function isScratchpadScheme(location, i = 0) {
199-
return location.charCodeAt(i) === CHAR_CODE_CAP_S &&
200-
location.charCodeAt(++i) === CHAR_CODE_C &&
201-
location.charCodeAt(++i) === CHAR_CODE_R &&
202-
location.charCodeAt(++i) === CHAR_CODE_A &&
203-
location.charCodeAt(++i) === CHAR_CODE_T &&
204-
location.charCodeAt(++i) === CHAR_CODE_C &&
205-
location.charCodeAt(++i) === CHAR_CODE_H &&
206-
location.charCodeAt(++i) === CHAR_CODE_P &&
207-
location.charCodeAt(++i) === CHAR_CODE_A &&
208-
location.charCodeAt(++i) === CHAR_CODE_D &&
209-
location.charCodeAt(++i) === CHAR_CODE_SLASH;
210-
}
211-
212187
function isDataScheme(location, i = 0) {
213188
return location.charCodeAt(i) === CHAR_CODE_D &&
214189
location.charCodeAt(++i) === CHAR_CODE_A &&
@@ -356,7 +331,6 @@ function getSourceMappedFile(source) {
356331
module.exports = {
357332
parseURL,
358333
getSourceNames,
359-
isScratchpadScheme,
360334
isChromeScheme,
361335
isContentScheme,
362336
isWASM,

packages/devtools-modules/src/tests/source-utils.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const {
88
isChromeScheme,
99
isContentScheme,
1010
isDataScheme,
11-
isScratchpadScheme,
1211
isWASM,
1312
parseURL,
1413
} = require("../source-utils");
@@ -79,12 +78,6 @@ describe("source-utils", () => {
7978
}
8079
});
8180

82-
it("isScratchpadTheme", () => {
83-
expect(isScratchpadScheme("Scratchpad/1")).toBe(true);
84-
expect(isScratchpadScheme("Scratchpad/20")).toBe(true);
85-
expect(isScratchpadScheme("http://www.mozilla.org")).toBe(false);
86-
});
87-
8881
it("getSourceMappedFile", () => {
8982
expect(getSourceMappedFile("baz.js")).toBe("baz.js");
9083
expect(getSourceMappedFile("/foo/bar/baz.js")).toBe("baz.js");

0 commit comments

Comments
 (0)