Vojtech Szocs has posted comments on this change.
Change subject: webadmin: Replace inner variable references in failure messages
......................................................................
Patch Set 2: Code-Review+2
Here are some facts for GWT RegExp class:
* com.google.gwt.regexp.shared.RegExp = default *server-side* implementation
using java.util.regex.Pattern (which is not emulated by GWT SDK)
* RegExp *client-side* implementation (used by GWT compiler) =
gwt-user-{version}.jar/com/google/gwt/regexp/super/com/google/gwt/regexp/shared/RegExp.java
* the client-side implementation just delegates to JavaScript RegExp object [1]
[1]
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/RegExp
So the variable replacement logic fixed by this patch essentially depends on
JavaScript RegExp.exec function behavior [2].
[2]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec
As mentioned in [3], by using "global" flag, invocation of "exec" method
updates the "lastIndex" (this behavior is consistent with server-side RegExp
implementation), which is why we need to reset "lastIndex" value to 0 to ensure
proper variable processing.
[3]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Example.3A_Finding_successive_matches
--
To view, visit http://gerrit.ovirt.org/26621
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If70582ae35b8f94b4101dfc33865cc7976fd625c
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches