summaryrefslogtreecommitdiffstats
path: root/dom/script/ModuleScript.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-08 12:58:30 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-30 09:33:06 +0000
commit498b1ab0c8db07784badbd2148f372027ef8cc27 (patch)
tree4b25652523fc84ca588671412b556195cef33d80 /dom/script/ModuleScript.h
parent2f145b6eda95c08a76711f0393e4d9ebe13a5f92 (diff)
downloadUXP-498b1ab0c8db07784badbd2148f372027ef8cc27.tar
UXP-498b1ab0c8db07784badbd2148f372027ef8cc27.tar.gz
UXP-498b1ab0c8db07784badbd2148f372027ef8cc27.tar.lz
UXP-498b1ab0c8db07784badbd2148f372027ef8cc27.tar.xz
UXP-498b1ab0c8db07784badbd2148f372027ef8cc27.zip
Issue #618 - Align error handling for module scripts with the spec (again)
This updates module implementation to match spec regarding handling of instantiation errors, after it was changed yet again, this time to not remember instantiation errors, but instead immediately rethrow applicable ones. Ref: BZ 1420420
Diffstat (limited to 'dom/script/ModuleScript.h')
-rw-r--r--dom/script/ModuleScript.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/dom/script/ModuleScript.h b/dom/script/ModuleScript.h
index 571359859..f765aa0fa 100644
--- a/dom/script/ModuleScript.h
+++ b/dom/script/ModuleScript.h
@@ -23,7 +23,8 @@ class ModuleScript final : public nsISupports
RefPtr<ScriptLoader> mLoader;
nsCOMPtr<nsIURI> mBaseURL;
JS::Heap<JSObject*> mModuleRecord;
- JS::Heap<JS::Value> mError;
+ JS::Heap<JS::Value> mParseError;
+ JS::Heap<JS::Value> mErrorToRethrow;
~ModuleScript();
@@ -35,14 +36,17 @@ public:
nsIURI* aBaseURL);
void SetModuleRecord(JS::Handle<JSObject*> aModuleRecord);
- void SetPreInstantiationError(const JS::Value& aError);
+ void SetParseError(const JS::Value& aError);
+ void SetErrorToRethrow(const JS::Value& aError);
ScriptLoader* Loader() const { return mLoader; }
JSObject* ModuleRecord() const { return mModuleRecord; }
nsIURI* BaseURL() const { return mBaseURL; }
- bool IsErrored() const;
- JS::Value Error() const;
+ JS::Value ParseError() const { return mParseError; }
+ JS::Value ErrorToRethrow() const { return mErrorToRethrow; }
+ bool HasParseError() const { return !mParseError.isUndefined(); }
+ bool HasErrorToRethrow() const { return !mErrorToRethrow.isUndefined(); }
void UnlinkModuleRecord();
};