summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-11 00:30:06 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-11 00:36:37 +0200
commit1484980f8fab5c24837844d773acf80cb8c4ad2a (patch)
tree6eba3faa3d1a322b3f6181cf0cb7b4ea5438e3bd /Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
parent6595db9ecf0ca0e92e77281fb20dae1f99bc6619 (diff)
downloadserenity-1484980f8fab5c24837844d773acf80cb8c4ad2a.zip
LibWeb+LibJS: Remember source filenames when using HTML::Script
It's a lot easier to debug JavaScript problems if you can see which file the errors are in. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
index 2642c00bca..f2c5330bca 100644
--- a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
+++ b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
@@ -20,7 +20,7 @@ public:
No,
Yes,
};
- static NonnullRefPtr<ClassicScript> create(StringView source, JS::GlobalObject&, URL base_url, MutedErrors = MutedErrors::No);
+ static NonnullRefPtr<ClassicScript> create(String filename, StringView source, JS::GlobalObject&, URL base_url, MutedErrors = MutedErrors::No);
JS::Script* script_record() { return m_script_record; }
JS::Script const* script_record() const { return m_script_record; }
@@ -32,7 +32,7 @@ public:
JS::Value run(RethrowErrors = RethrowErrors::No);
private:
- explicit ClassicScript(URL base_url);
+ ClassicScript(URL base_url, String filename);
RefPtr<JS::Script> m_script_record;
MutedErrors m_muted_errors { MutedErrors::No };