refactor(dart/transform): Remove unnecessary getter/setter codegen
Currently the transformer generates all getters and setters even when creating pre-generated change detectors, which remove the need for them. Generate getters and setters via the model provided by `ProtoViewDto`, which contains enough information to allow omitting unnecessary getters and setters from code output. Allow generating getters, setters, and method names which are Dart pseudo keywords. Closes #3489
This commit is contained in:
@ -490,14 +490,11 @@ export class _ParseAST {
|
||||
new MethodCall(receiver, id, fn, args);
|
||||
|
||||
} else {
|
||||
let getter = this.reflector.getter(id);
|
||||
let setter = this.reflector.setter(id);
|
||||
|
||||
if (isSafe) {
|
||||
if (this.optionalOperator("=")) {
|
||||
this.error("The '?.' operator cannot be used in the assignment");
|
||||
} else {
|
||||
return new SafePropertyRead(receiver, id, getter);
|
||||
return new SafePropertyRead(receiver, id, this.reflector.getter(id));
|
||||
}
|
||||
} else {
|
||||
if (this.optionalOperator("=")) {
|
||||
@ -506,9 +503,9 @@ export class _ParseAST {
|
||||
}
|
||||
|
||||
let value = this.parseConditional();
|
||||
return new PropertyWrite(receiver, id, setter, value);
|
||||
return new PropertyWrite(receiver, id, this.reflector.setter(id), value);
|
||||
} else {
|
||||
return new PropertyRead(receiver, id, getter);
|
||||
return new PropertyRead(receiver, id, this.reflector.getter(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user