Comparing version 1.2.0 to 1.2.1
@@ -9,2 +9,3 @@ 'use strict'; | ||
var jsdom = {}; | ||
var jsdomErr = null; | ||
try | ||
@@ -16,2 +17,4 @@ { | ||
{ | ||
/* istanbul ignore next */ | ||
jsdomErr = err; | ||
} | ||
@@ -44,3 +47,19 @@ | ||
/* istanbul ignore next */ | ||
function maybeJsdomError(error) | ||
{ | ||
if (jsdomErr) | ||
{ | ||
error.message += '\nJsdom might fail to load because of this error: ' + | ||
jsdomErr.message + | ||
'\n' + | ||
jsdomErr.stack; | ||
} | ||
error.jsdomCause = jsdomErr; | ||
return error; | ||
} | ||
/** Test if the current environment / browser / DOM library supports everything that is needed for the domv library. | ||
@@ -644,3 +663,6 @@ * @param {!external:Document} document | ||
{ | ||
throw new domv.Exception(Error('Unable to find a Document implementation in domv.createHtmlDomDocument(). The browser is too old, or jsdom is not installed (node.js/io.js)')); | ||
throw maybeJsdomError(new domv.Exception(Error( | ||
'Unable to find a Document implementation in domv.createHtmlDomDocument(). ' + | ||
'The browser is too old, or jsdom is not installed (node.js/io.js).' | ||
))); | ||
} | ||
@@ -696,3 +718,6 @@ }; | ||
// Safari / jsdom missing | ||
throw domv.Exception(Error('Unable to find a DOM parser implementation in domv.parseHTMLDocument(). The browser is too old, or jsdom is not installed (node.js/io.js)')); | ||
throw maybeJsdomError(domv.Exception(Error( | ||
'Unable to find a DOM parser implementation in domv.parseHTMLDocument(). ' + | ||
'The browser is too old, or jsdom is not installed (node.js/io.js)' | ||
))); | ||
} | ||
@@ -699,0 +724,0 @@ |
{ | ||
"name": "domv", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": "Joris van der Wel <joris@jorisvanderwel.com>", | ||
@@ -5,0 +5,0 @@ "description": "Create views as components using DOM. Run the same code on the browser and on the server.", |
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
353873
5402