Update to latest RC of Oxygen.2

This commit is contained in:
Mat Booth 2017-11-21 21:37:57 +00:00
parent d4a43f6b61
commit 4e6fc1865a
4 changed files with 10 additions and 92 deletions

View File

@ -1,81 +0,0 @@
From 9c3c5c10465f18f1082ce1bcfe5393eb98ef053c Mon Sep 17 00:00:00 2001
From: Leo Ufimtsev
Date: Fri, 29 Sep 2017 11:57:53 -0400
Subject: Bug 525340 [Gtk][Webkit2] Javascript evaluate fails with
"SyntaxError: Return statements are only valid inside functions"
Wrapping evaluate logic into a function to deal with corner
case where 'return' is not at the beginnign of the script.
Tested with all Browser jUnit tests.
Change-Id: Icb7c6d29006a0382fb5525bd7184101c3ea0cbdd
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
---
.../gtk/org/eclipse/swt/browser/WebKit.java | 26 ++++++++++------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
index f9361e1..1227298 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
@@ -1216,7 +1216,7 @@
// Mechanism to generate unique ID's
private static int nextCallbackId = 1;
private static HashSet<Integer> usedCallbackIds = new HashSet<>();
- private static int getNextId() {
+ static int getNextId() {
int value = 0;
boolean unique = false;
while (unique == false) {
@@ -1236,28 +1236,26 @@
}
static Object evaluate(String script, Browser browser, long /*int*/ webView, boolean doNotBlock) {
- /* Webkit2: We remove the 'return' prefix that normally comes with the script.
- * The reason is that in Webkit1, script was wrapped into a function and if an exception occured
- * it was caught on Javascript side and a callback to java was made.
- * In Webkit2, we handle errors in the callback, no need to wrap them in a function anymore.
+ /* Wrap script around a function for backwards compatibility,
+ * user can specify 'return', which may not be at the beginning of the script.
+ * Valid scripts:
+ * 'hi'
+ * return 'hi'
+ * var x = 1; return 'hi'
*/
- String fixedScript;
- if (script.length() > 7 && script.substring(0, 7).equals("return ")) {
- fixedScript = script.substring(7);
- } else {
- fixedScript = script;
- }
+ String swtUniqueExecFunc = "SWTWebkit2TempFunc" + CallBackMap.getNextId() + "()";
+ String wrappedScript = "function " + swtUniqueExecFunc +"{" + script + "}; " + swtUniqueExecFunc;
if (doNotBlock) {
// Execute script, but do not wait for async call to complete. (assume it does). Bug 512001.
- WebKitGTK.webkit_web_view_run_javascript(webView, Converter.wcsToMbcs(fixedScript, true), 0, 0, 0);
+ WebKitGTK.webkit_web_view_run_javascript(webView, Converter.wcsToMbcs(wrappedScript, true), 0, 0, 0);
return null;
} else {
// Callback logic: Initiate an async callback and wait for it to finish.
// The callback comes back in javascriptExecutionFinishedProc(..) below.
Webkit2EvalReturnObj retObj = new Webkit2EvalReturnObj();
int callbackId = CallBackMap.putObject(retObj);
- WebKitGTK.webkit_web_view_run_javascript(webView, Converter.wcsToMbcs(fixedScript, true), 0, callback.getAddress(), callbackId);
+ WebKitGTK.webkit_web_view_run_javascript(webView, Converter.wcsToMbcs(wrappedScript, true), 0, callback.getAddress(), callbackId);
Shell shell = browser.getShell();
Display display = browser.getDisplay();
while (!shell.isDisposed()) {
@@ -1270,7 +1268,7 @@
CallBackMap.removeObject(callbackId);
if (retObj.errorNum != 0) {
- throw new SWTException(retObj.errorNum, retObj.errorMsg);
+ throw new SWTException(retObj.errorNum, retObj.errorMsg +"\nScript that was evaluated:\n" + wrappedScript);
} else {
return retObj.returnValue;
}
--
cgit v1.1

View File

@ -5,8 +5,8 @@
Epoch: 1
%global eb_commit 2ec387778205043124434190b43f747551fd36fc
%global eclipse_tag R4_7_1a
%global eb_commit 81122c55c72d9e308302c878f642f93c39507436
%global eclipse_tag S4_7_2_RC2
%global _jetty_version 9.4.6
%global _lucene_version 6.1.0
@ -37,8 +37,8 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: 4.7.1
Release: 8%{?dist}
Version: 4.7.2
Release: 0.1%{?dist}
License: EPL
URL: http://www.eclipse.org/
@ -126,9 +126,6 @@ Patch29: fix_ant_build.patch
# Hide the p2 Droplets from cluttering Install Wizard Combo
Patch30: eclipse-hide-droplets-from-install-wizard.patch
# Fix webkit/javascript problem affecting jboss
Patch31: eclipse-bug-525340.patch
# Use the jit on 32bit arm to speed up the build
%ifarch %{arm}
BuildRequires: java-1.8.0-openjdk-aarch32-devel
@ -415,7 +412,6 @@ tar --strip-components=1 -xf %{SOURCE1}
%endif
%patch29
%patch30
%patch31 -p1
# Use ecj when bootstrapping
%if %{bootstrap}
@ -1107,6 +1103,9 @@ fi
%{_eclipsedir}/plugins/org.eclipse.osgi.util_*
%changelog
* Tue Nov 21 2017 Mat Booth <mat.booth@redhat.com> - 1:4.7.2-0.1
- Update to latest RC of Oxygen.2
* Fri Nov 17 2017 Mat Booth <mat.booth@redhat.com> - 1:4.7.1-8
- Make java 9 api stubs available for use
- Migrate away from deprecated maven depmap macros

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e
AGGREGATOR_PATH=git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git
TAG=R4_7_1a
TAG=S4_7_2_RC2
rm -rf R4_platform-aggregator-$TAG
rm -rf R4_platform-aggregator-$TAG.tar.xz

View File

@ -1,2 +1,2 @@
SHA512 (org.eclipse.linuxtools.eclipse-build-2ec387778205043124434190b43f747551fd36fc.tar.xz) = ce351ac1658304b9d2661dde73d7f0bd3e7e57c690cfac561bf08f4d14a3db0b7ffe0cac27d75f4ef7b31fefd7ebe65383e68873f8e0083758949dd7ec8f46b0
SHA512 (R4_platform-aggregator-R4_7_1a.tar.xz) = 95c9910d36b3d8b2360d396def359c6c9724eaf77b9df04449367262e45fe5afa637c96eb413293ce9919fc57d7f81e9bc7e72f1f04add2066d49c39b6bce67a
SHA512 (org.eclipse.linuxtools.eclipse-build-81122c55c72d9e308302c878f642f93c39507436.tar.xz) = 170d6801fd2c2f5f95c4d79cb14e36bb5db63142a52cafea81656f63dd132cf1a5b52b945fa0f85d4eed21ed660d22f46d2cdf9cde86e08fed06b16e9a22ed51
SHA512 (R4_platform-aggregator-S4_7_2_RC2.tar.xz) = d10ed3848c02a6c112b3d29110f02ffb0c5e75d2b2cd708c4c7c38f471ec53d20b36806094bea0c4d08fbf87f493073543bc12594c65f260112cbeaeab6a307d