Skip to content

Commit 9e85a67

Browse files
committed
make Promise global
1 parent 21aa7b3 commit 9e85a67

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

build/scripts/main.js

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fjsContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const { FishPlayer } = players;
2626
const { Rank, RoleFlag } = ranks;
2727
const { menu } = menus;
2828

29-
Object.assign(this as never, utils); //global scope goes brrrrr, I'm sure this will not cause any bugs whatsoever
29+
Object.assign(this as never as typeof globalThis, utils); //global scope goes brrrrr, I'm sure this will not cause any bugs whatsoever
3030

3131
const Ranks = null!;
3232

src/main.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Array.prototype.flat = function(depth){
3333
}
3434
String.raw = function(callSite){
3535
const substitutions = Array.prototype.slice.call(arguments, 1);
36-
return Array.from(callSite.raw).map((chunk, i) => {
37-
if (callSite.raw.length <= i) {
38-
return chunk;
39-
}
40-
return substitutions[i - 1] ? substitutions[i - 1] + chunk : chunk;
41-
}).join('');
36+
return Array.from(callSite.raw).map((chunk, i) => {
37+
if (callSite.raw.length <= i) {
38+
return chunk;
39+
}
40+
return substitutions[i - 1] ? substitutions[i - 1] + chunk : chunk;
41+
}).join('');
4242
}
4343
//Fix rhino regex
4444
if(/ae?a/.test("aeea")){
@@ -48,4 +48,5 @@ if(/ae?a/.test("aeea")){
4848
};
4949
}
5050

51-
require("index");
51+
this.Promise = require('promise').Promise;
52+
require("index");

0 commit comments

Comments
 (0)