diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-31 15:29:05 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-06-03 06:46:52 +0000 |
commit | 23c222f61b260b56c10775197d6100f130d558b4 (patch) | |
tree | 513c9d0f65d9f7f9ec4884c64db7f92f858beaa2 /src/plugins/coreplugin | |
parent | d73c27125952bcce920a2abd55c7c3758e850ac0 (diff) | |
download | qt-creator-23c222f61b260b56c10775197d6100f130d558b4.tar.gz |
Fix C++ Library wizard when compiled with Qt < 5.12
Only Qt 5.12 got true ECMA Script capabilities, so arrow function
expressions are not supported before that.
To be able to use "regular" inline functions, we allow usage of } by escaping with backslash.
For variables that do not start with "JS:" we already supported backslash for escaping.
Fixes: QTCREATORBUG-22336
Change-Id: I9fc638e64d2757a21fffc16355635e2fcff87a36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r-- | src/plugins/coreplugin/jsexpander.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/jsexpander.cpp b/src/plugins/coreplugin/jsexpander.cpp index 5aa9279c7c..4ee72752e5 100644 --- a/src/plugins/coreplugin/jsexpander.cpp +++ b/src/plugins/coreplugin/jsexpander.cpp @@ -111,7 +111,9 @@ void JsExpander::registerForExpander(Utils::MacroExpander *macroExpander) "JS", QCoreApplication::translate("Core::JsExpander", "Evaluate simple JavaScript statements.<br>" - "The statements may not contain '{' nor '}' characters."), + "Literal '}' characters must be escaped as \"\\}\", " + "'\\' characters must be escaped as \"\\\\\", " + "and \"%{\" must be escaped as \"%\\{\"."), [this](QString in) -> QString { QString errorMessage; QString result = evaluate(in, &errorMessage); |