Skip to content
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

Fix "Invalid calling object" in Edge and ES6 syntax error in IE #321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ie 10
10 changes: 5 additions & 5 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ api.IdentifierIssuer = IdentifierIssuer;
// from https://github.com/caolan/async/blob/master/lib/async.js

// capture the global reference to guard against fakeTimer mocks
const _setImmediate = typeof setImmediate === 'function' && setImmediate;
const _setImmediate = typeof setImmediate === 'function'
// not a direct alias to prevent "Invalid calling object" error in IE and Edge
? fn => setImmediate(fn)
: undefined;

const _delay = _setImmediate ?
// not a direct alias (for IE10 compatibility)
fn => _setImmediate(fn) :
fn => setTimeout(fn, 0);
const _delay = _setImmediate || (fn => setTimeout(fn, 0));

if(typeof process === 'object' && typeof process.nextTick === 'function') {
api.nextTick = process.nextTick;
Expand Down
11 changes: 4 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,10 @@ outputs.forEach(info => {
rules: [
{
test: /\.js$/,
include: [{
// exclude node_modules by default
exclude: /(node_modules)/
}, {
// include rdf-canonize
include: /(node_modules\/rdf-canonize)/
}],
include: [
path.join(__dirname, 'lib'),
path.join(__dirname, 'node_modules', 'rdf-canonize'),
],
use: {
loader: 'babel-loader',
options: {
Expand Down