This is an automated email from the ASF dual-hosted git repository.
cbrisson pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/velocity-site.git
The following commit(s) were added to refs/heads/main by this push:
new 9759c8f Add notice about operators precedence
9759c8f is described below
commit 9759c8f8e6d445287462a18f04c062618f28382d
Author: Claude Brisson <[email protected]>
AuthorDate: Sat Feb 27 08:12:22 2021 +0100
Add notice about operators precedence
---
src/content/engine/2.0/upgrading.mdtext | 1 +
src/content/engine/2.1/upgrading.mdtext | 1 +
src/content/engine/devel/upgrading.mdtext | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/content/engine/2.0/upgrading.mdtext
b/src/content/engine/2.0/upgrading.mdtext
index 6dd4ad3..4a28f74 100644
--- a/src/content/engine/2.0/upgrading.mdtext
+++ b/src/content/engine/2.0/upgrading.mdtext
@@ -50,6 +50,7 @@ Read below for futher details.
+ the #foreach predefined references `$velocityCount` and `$velocityHasNext`
have been removed. Use `$foreach.count` (1-based), `$foreach.index` (0-based)
and `foreach.hasNext()`.
+ Velocimacro arguments are now evaluated only once (instead of each time they
were referenced inside the macro body as was the case for v1.7) and passed by
value (or more precisely as reference after evaluation).
+ Velocimacros do not anymore have a *proxy context* of their own - if they do
insert new values in the context, and then call an external code changing those
values, they will now see the new values.
++ 2.0 follows a [standard operators precedence
rule](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html),
whereas with 1.7 the expression `! "$foo" == 'bar'` will, wrongly, evaluate
the equality before the unary negation.
### Dependency Changes
diff --git a/src/content/engine/2.1/upgrading.mdtext
b/src/content/engine/2.1/upgrading.mdtext
index 16d68da..d784427 100644
--- a/src/content/engine/2.1/upgrading.mdtext
+++ b/src/content/engine/2.1/upgrading.mdtext
@@ -101,6 +101,7 @@ Read below for futher details.
+ the #foreach predefined references `$velocityCount` and `$velocityHasNext`
have been removed. Use `$foreach.count` (1-based), `$foreach.index` (0-based)
and `foreach.hasNext()`.
+ Velocimacro arguments are now evaluated only once (instead of each time they
were referenced inside the macro body as was the case for v1.7) and passed by
value (or more precisely as reference after evaluation).
+ Velocimacros do not anymore have a *proxy context* of their own - if they do
insert new values in the context, and then call an external code changing those
values, they will now see the new values.
++ 2.x follows a [standard operators precedence
rule](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html),
whereas with 1.7 the expression `! "$foo" == 'bar'` will, wrongly, evaluate
the equality before the unary negation.
### Dependency Changes
diff --git a/src/content/engine/devel/upgrading.mdtext
b/src/content/engine/devel/upgrading.mdtext
index c64f046..93c275c 100644
--- a/src/content/engine/devel/upgrading.mdtext
+++ b/src/content/engine/devel/upgrading.mdtext
@@ -147,7 +147,8 @@ Read below for futher details.
+ space gobbling (to control the indentation of generated code) is now
configurable via the `space.gobbing` configuration key, which can take the
following values: `none`, `bc` (aka. backward compatible), `lines` and
`structured`. See the related documentation section for details. To maximize
backward compatibility with 1.x, set it to `bc`.
+ the #foreach predefined references `$velocityCount` and `$velocityHasNext`
have been removed. Use `$foreach.count` (1-based), `$foreach.index` (0-based)
and `foreach.hasNext()`.
+ Velocimacro arguments are now evaluated only once (instead of each time they
were referenced inside the macro body as was the case for v1.7) and passed by
value (or more precisely as reference after evaluation).
-+ Velocimacros do not anymore have a *proxy context* of their own - if they do
insert new values in the context, and then call an external code changing those
values, they will now see the new values (see 2.2 for the
velicomacro.enable_bc_mode backward compatibility flag).
++ Velocimacros do not anymore have a *proxy context* of their own - if they do
insert new values in the context, and then call an external code changing those
values, they will now see the new values (see 2.2 for the
velocimacro.enable_bc_mode backward compatibility flag).
++ 2.x follows a [standard operators precedence
rule](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html),
whereas with 1.7 the expression `! "$foo" == 'bar'` will, wrongly, evaluate
the equality before the unary negation.
### Dependency Changes