Skip to content

Commit

Permalink
Merge pull request #557 from Aladdin-ADD/feat/support-sw
Browse files Browse the repository at this point in the history
feat: runtime 支持 sw & webworker
  • Loading branch information
aui authored Oct 25, 2018
2 parents b6ebefe + 1f19d37 commit 70c588b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/template-web.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/compile/runtime.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/*! art-template@runtime | https://github.com/aui/art-template */

const detectNode = typeof window === 'undefined';
const runtime = Object.create(detectNode ? global : window);
const globalThis = typeof self !== 'undefined' ? self
: typeof window !== 'undefined' ? window
: typeof global !== 'undefined' ? global : {};

const runtime = Object.create(globalThis);
const ESCAPE_REG = /["&'<>]/;

/**
Expand Down

0 comments on commit 70c588b

Please sign in to comment.