[vala] codegen: Do not use accept_children for properties
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Do not use accept_children for properties
- Date: Sun, 10 Oct 2010 16:37:56 +0000 (UTC)
commit 151731e4d4afd12a1d7b19dcd6a5e81c3d1415a6
Author: Jürg Billeter <j bitron ch>
Date: Sun Oct 10 10:14:52 2010 +0200
codegen: Do not use accept_children for properties
Accepting initializer may have side-effects.
codegen/valaccodebasemodule.vala | 7 ++++++-
codegen/valadovabasemodule.vala | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index f446ed1..3e66d69 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1225,7 +1225,12 @@ public class Vala.CCodeBaseModule : CodeGenerator {
check_type (prop.property_type);
- prop.accept_children (this);
+ if (prop.get_accessor != null) {
+ prop.get_accessor.accept (this);
+ }
+ if (prop.set_accessor != null) {
+ prop.set_accessor.accept (this);
+ }
}
public void generate_type_declaration (DataType type, CCodeFile decl_space) {
diff --git a/codegen/valadovabasemodule.vala b/codegen/valadovabasemodule.vala
index 64fcfbc..567b0ba 100644
--- a/codegen/valadovabasemodule.vala
+++ b/codegen/valadovabasemodule.vala
@@ -546,7 +546,12 @@ public class Vala.DovaBaseModule : CodeGenerator {
}
public override void visit_property (Property prop) {
- prop.accept_children (this);
+ if (prop.get_accessor != null) {
+ prop.get_accessor.accept (this);
+ }
+ if (prop.set_accessor != null) {
+ prop.set_accessor.accept (this);
+ }
}
public void generate_type_declaration (DataType type, CCodeFile decl_space) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]