Skip to content

Commit a04b393

Browse files
Fix #33
1 parent 5acb9c4 commit a04b393

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-ioc",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "A Lightweight annotation-based dependency injection container for typescript.",
55
"author": "Thiago da Rosa de Bustamante <[email protected]>",
66
"scripts": {

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
22

33
const isBrowser = new Function('try {return this===window;}catch(e){return false;}');
4+
const isWebWorker = new Function('try {return self instanceof WorkerGlobalScope;}catch(e){return false;}');
45

56
let useES6 = false;
6-
if (!isBrowser()) {
7+
if (!isBrowser() && !isWebWorker()) {
78
useES6 = process.env.ES6 === 'true';
89
if (!useES6) {
910
const fs = require('fs');

0 commit comments

Comments
 (0)