[Pkg-javascript-commits] [node-util-deprecate] 01/05: Imported Upstream version 1.0.2

Ross Gammon ross-guest at moszumanska.debian.org
Tue Oct 20 18:06:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

ross-guest pushed a commit to branch master
in repository node-util-deprecate.

commit 92fe3ef2e94b65f1d705edc9594282884da71bce
Author: Ross Gammon <rossgammon at mail.dk>
Date:   Tue Oct 20 19:34:52 2015 +0200

    Imported Upstream version 1.0.2
---
 History.md   | 5 +++++
 browser.js   | 7 ++++++-
 package.json | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/History.md b/History.md
index ec01029..acc8675 100644
--- a/History.md
+++ b/History.md
@@ -1,4 +1,9 @@
 
+1.0.2 / 2015-10-07
+==================
+
+  * use try/catch when checking `localStorage` (#3, @kumavis)
+
 1.0.1 / 2014-11-25
 ==================
 
diff --git a/browser.js b/browser.js
index 55fa5a4..549ae2f 100644
--- a/browser.js
+++ b/browser.js
@@ -55,7 +55,12 @@ function deprecate (fn, msg) {
  */
 
 function config (name) {
-  if (!global.localStorage) return false;
+  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+  try {
+    if (!global.localStorage) return false;
+  } catch (_) {
+    return false;
+  }
   var val = global.localStorage[name];
   if (null == val) return false;
   return String(val).toLowerCase() === 'true';
diff --git a/package.json b/package.json
index 9b7462e..2e79f89 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "util-deprecate",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "The Node.js `util.deprecate()` function with browser support",
   "main": "node.js",
   "browser": "browser.js",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-util-deprecate.git



More information about the Pkg-javascript-commits mailing list