apache / apache/royale-compiler

Binding issue (error-related)

Open
#188 2 comments 0 reactions 1 assignee Claimed by @greg-dove View on GitHub
Dominant language
Java
Stars
113
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Here is an example:

```
private var _config:SomeTypedObject;

[Bindable]
public function get config():SomeTypedObject
{
return this._config;
}

public function set config(SomeTypedObject):void
{
this._config = value;

// Do something that causes an NPE. In this case, someProperty is null.
warning = config.someProperty.length == 0;
}
```

In this scenario, sub properties of config is bound to various fields. Because of the NPE, none of the bindings for this field fire, even though the value is set before the NPE. No error appears in the console or debugger. It's as if it's caught and suppressed at runtime.

Now that I think about it, it may be about how the compiler converts generic `[Bindable]` fields to dispatch the updated event. I'm betting in this case, if I were to use my own event name and dispatch before the NPE, it would probably work.

_Originally posted by @brianraymes in https://github.com/apache/royale-compiler/issues/185#issuecomment-864335780_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.