Discussion:
[dart-misc] Trouble mixing dart:js and package:js
r***@gmail.com
2017-08-26 01:16:51 UTC
Permalink
Ok, I have some code that's using dart:js, in particular JsObject. On the
other side, I have code that's using package:js. Here's the gist of my
problem:

The code looks kinda like this:
@anonymous
@JS()
class MyCls {
external int foo;
external factory MyCls({int foo});
}

// ...

JsObject obj = new JsObject.jsify([new MyCls(foo: 1)]);

The problem is that I end up getting something like this:

[{'o': {'foo': 1}}]

Note the superfluous key `o`. It just messes everything up! Am I missing
something here?


--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone
elsehttp://refi64.com
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2017-08-27 13:25:48 UTC
Permalink
dart:js and package:js can be used together in the same app, but their
values aren't supposed to be compatible.
Post by r***@gmail.com
Ok, I have some code that's using dart:js, in particular JsObject. On the
other side, I have code that's using package:js. Here's the gist of my
@anonymous
@JS()
class MyCls {
external int foo;
external factory MyCls({int foo});
}
// ...
JsObject obj = new JsObject.jsify([new MyCls(foo: 1)]);
[{'o': {'foo': 1}}]
Note the superfluous key `o`. It just messes everything up! Am I missing
something here?
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone elsehttp://refi64.com
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
r***@gmail.com
2017-08-27 14:22:34 UTC
Permalink
Ok. Thanks!


--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone
elsehttp://refi64.com

On Aug 27, 2017 at 8:25 AM, <GÌnter Zöchbauer <***@gmail.com>> wrote:

dart:js and package:js can be used together in the same app, but their
values aren't supposed to be compatible.
Post by r***@gmail.com
Ok, I have some code that's using dart:js, in particular JsObject. On the
other side, I have code that's using package:js. Here's the gist of my
@anonymous
@JS()
class MyCls {
external int foo;
external factory MyCls({int foo});
}
// ...
JsObject obj = new JsObject.jsify([new MyCls(foo: 1)]);
[{'o': {'foo': 1}}]
Note the superfluous key `o`. It just messes everything up! Am I missing
something here?
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone elsehttp://refi64.com
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to misc+***@dartlang.org.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...