summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-10-25 12:08:30 -0500
committerxjm2017-10-25 12:08:30 -0500
commit5951ea0d1b3f730f8c2997bb8816dcc1175018bd (patch)
tree16412a519a17096035392bfff7a8769e4e390ecc
parentccde72d3456859e2e6b5e1ca789df61f19c445d1 (diff)
Issue #2914713 by droplet, drpal, dawehner, nod_: JS codestyle: no-throw-literal
-rw-r--r--core/.eslintrc.passing.json1
-rw-r--r--core/modules/quickedit/js/quickedit.es6.js2
-rw-r--r--core/modules/quickedit/js/quickedit.js2
3 files changed, 2 insertions, 3 deletions
diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json
index d33b7cb..a1d1428 100644
--- a/core/.eslintrc.passing.json
+++ b/core/.eslintrc.passing.json
@@ -2,7 +2,6 @@
"extends": "./.eslintrc.json",
"rules": {
"no-use-before-define": "off",
- "no-throw-literal": "off",
"no-shadow": "off",
"no-restricted-syntax": "off",
"no-new": "off",
diff --git a/core/modules/quickedit/js/quickedit.es6.js b/core/modules/quickedit/js/quickedit.es6.js
index 84fee16..ba74203 100644
--- a/core/modules/quickedit/js/quickedit.es6.js
+++ b/core/modules/quickedit/js/quickedit.es6.js
@@ -364,7 +364,7 @@
// If there are no elements returned from `entityElementSelector`
// throw an error. Check the browser console for this message.
if (!$entityElement.length) {
- throw `Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="${fieldID}"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="${entityID}"]. This is typically caused by the theme's template for this entity type forgetting to print the attributes.`;
+ throw new Error(`Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="${fieldID}"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="${entityID}"]. This is typically caused by the theme's template for this entity type forgetting to print the attributes.`);
}
let entityElement = $(fieldElement).closest($entityElement);
diff --git a/core/modules/quickedit/js/quickedit.js b/core/modules/quickedit/js/quickedit.js
index 5c2cd95..4548c01 100644
--- a/core/modules/quickedit/js/quickedit.js
+++ b/core/modules/quickedit/js/quickedit.js
@@ -162,7 +162,7 @@
var $entityElement = $(entityElementSelector);
if (!$entityElement.length) {
- throw 'Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="' + fieldID + '"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="' + entityID + '"]. This is typically caused by the theme\'s template for this entity type forgetting to print the attributes.';
+ throw new Error('Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="' + fieldID + '"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="' + entityID + '"]. This is typically caused by the theme\'s template for this entity type forgetting to print the attributes.');
}
var entityElement = $(fieldElement).closest($entityElement);