Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generateJsProps should use jsify(dartMap) #392

Open
ryanheise opened this issue Apr 11, 2024 · 0 comments
Open

generateJsProps should use jsify(dartMap) #392

ryanheise opened this issue Apr 11, 2024 · 0 comments

Comments

@ryanheise
Copy link

I've found that generateJsProps will produce an incorrect JsMap when one of the values in the Map is a JS constructor (a JavaScriptFunction in the Dart type system). However, jsify() produces the correct conversion. The following changes fix it:

class JsBackedMap extends MapBase<dynamic, dynamic> {
  JsBackedMap() : jsObject = js_util.jsify({});
  factory JsBackedMap.from(Map other) => JsBackedMap.backedBy(js_util.jsify(other));
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant