From 6563f38496d61982e776e50b7b89bc912008d184 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 22 Oct 2017 17:36:27 +0200 Subject: [PATCH] Make wxJSScriptWrapper methods const Do not mark as const their returned values, which is useless, and seems to have been a result of some confusion about how "const" works in C++. --- include/wx/private/jsscriptwrapper.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/private/jsscriptwrapper.h b/include/wx/private/jsscriptwrapper.h index 7daf9cc927..77ada41db3 100644 --- a/include/wx/private/jsscriptwrapper.h +++ b/include/wx/private/jsscriptwrapper.h @@ -19,7 +19,7 @@ class wxJSScriptWrapper { public: - wxJSScriptWrapper(const wxString& js, int* runScriptCount) : m_jsscript(js) + wxJSScriptWrapper(const wxString& js, int* runScriptCount) : m_escapedCode(js) { // We assign the return value of JavaScript snippet we execute to the @@ -39,13 +39,13 @@ public: // This method is used to add a double quote level into a JavaScript code // in order to get it working when eval is called programmatically. - const wxString GetWrappedCode() + wxString GetWrappedCode() const { return wxString::Format("try { var %s = eval(\"%s\"); true; } \ catch (e) { e.name + \": \" + e.message; }", m_outputVarName, m_escapedCode); } - const wxString GetOutputCode() + wxString GetOutputCode() const { #if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__) return wxString::Format("if (typeof %s == 'object') \ @@ -131,12 +131,12 @@ public: #endif } - const wxString GetCleanUpCode() + wxString GetCleanUpCode() const { return wxString::Format("%s = undefined;", m_outputVarName); } - const wxString GetOutputJSVariable() + wxString GetOutputJSVariable() const { return m_outputVarName; }