summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/webidl/00_webidl.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js
index 88384406a..d5bad4f15 100644
--- a/ext/webidl/00_webidl.js
+++ b/ext/webidl/00_webidl.js
@@ -359,11 +359,11 @@
};
converters.DOMString = function (V, opts = {}) {
- if (opts.treatNullAsEmptyString && V === null) {
+ if (typeof V === "string") {
+ return V;
+ } else if (V === null && opts.treatNullAsEmptyString) {
return "";
- }
-
- if (typeof V === "symbol") {
+ } else if (typeof V === "symbol") {
throw makeException(
TypeError,
"is a symbol, which cannot be converted to a string",