@wry/context
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -98,12 +98,17 @@ var currentContext = null; | ||
args, thisArg) { | ||
var saved = currentContext; | ||
try { | ||
currentContext = null; | ||
// Function.prototype.apply allows the arguments array argument to be | ||
// omitted or undefined, so args! is fine here. | ||
if (currentContext) { | ||
var saved = currentContext; | ||
try { | ||
currentContext = null; | ||
// Function.prototype.apply allows the arguments array argument to be | ||
// omitted or undefined, so args! is fine here. | ||
return callback.apply(thisArg, args); | ||
} | ||
finally { | ||
currentContext = saved; | ||
} | ||
} | ||
else { | ||
return callback.apply(thisArg, args); | ||
} | ||
finally { | ||
currentContext = saved; | ||
} | ||
} | ||
@@ -110,0 +115,0 @@ function setTimeoutWithContext(callback, delay) { |
@@ -102,12 +102,17 @@ 'use strict'; | ||
args, thisArg) { | ||
var saved = currentContext; | ||
try { | ||
currentContext = null; | ||
// Function.prototype.apply allows the arguments array argument to be | ||
// omitted or undefined, so args! is fine here. | ||
if (currentContext) { | ||
var saved = currentContext; | ||
try { | ||
currentContext = null; | ||
// Function.prototype.apply allows the arguments array argument to be | ||
// omitted or undefined, so args! is fine here. | ||
return callback.apply(thisArg, args); | ||
} | ||
finally { | ||
currentContext = saved; | ||
} | ||
} | ||
else { | ||
return callback.apply(thisArg, args); | ||
} | ||
finally { | ||
currentContext = saved; | ||
} | ||
} | ||
@@ -114,0 +119,0 @@ function setTimeoutWithContext(callback, delay) { |
{ | ||
"name": "@wry/context", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": "Ben Newman <ben@eloper.dev>", | ||
@@ -31,3 +31,3 @@ "description": "Manage contextual information needed by (a)synchronous tasks without explicitly passing objects around", | ||
}, | ||
"gitHead": "955e81f294d1149cecf4b86d0aff305ce3790fb7" | ||
"gitHead": "cec6db29c1dcc43333f87ef00f9acdbc98b8930e" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18591
360