Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove eval #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eg-zhuravlev wants to merge 1 commit into artifact-project:master
base: master
Choose a base branch
Loading
from eg-zhuravlev:remove_eval
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion keeper/.gitignore
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ typings/

# Distributive
compiled
*.d.ts
*.d.ts

# Except these
!/__types__/*.d.ts
1 change: 1 addition & 0 deletions keeper/__types__/global.d.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const global: any;
3 changes: 2 additions & 1 deletion keeper/src/keeper/keeper.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const nil = null;
const BOLD = 'font-weight: bold;';
constglobalThis=Function('return this')()as Window & {
typeGlobalThis= Window & {
Date: DateConstructor;
perfKeeper?: {
system: PerfKeeper;
};
};
const globalThis = typeof window === 'undefined' ? typeof global === 'undefined' ? this : global : window as GlobalThis;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Во, я просто не донес, сделай также как тут:
https://gist.github.com/RubaXa/078395065c3aa0ffee557fe072a70c57#file-global-ts-L3-L8

const Date = globalThis.Date;

const dateNow = Date.now;
Expand Down
1 change: 1 addition & 0 deletions performance/__types__/global.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const global: any;
3 changes: 2 additions & 1 deletion performance/src/performance/performance.ts
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export function polyfill<T extends object>(global: T) {
};
}

const globalThis = polyfill(new Function('return this'));
const globalObject = typeof window === 'undefined' ? typeof global === 'undefined' ? this : global : window;
const globalThis = polyfill(globalObject);

if (typeof self !== 'undefined' && (self as any) !== globalThis) {
polyfill(self);
Expand Down

AltStyle によって変換されたページ (->オリジナル) /