Closed rafbermudez closed 7 years ago
We are still investigating what could have changed since 1.19.
The warning message isn't very helpful. Could you maybe show the concrete class that isn't working anymore, and state what exactly isn't working?
thanks.
When I upgraded to angular 3 I changed sdk to 1.23. But starting from a clean installation, this trivial test is not working after dart2js:
library test_dartson;
import '../lib/dartson.dart';
import 'package:test/test.dart';
void main() {
var dson = new Dartson.JSON();
test('trivial test', () {
Map map = {"key1": "val1"};
String str = dson.encode(map);
expect(str, '{"key1":"val1"}');
});
}
case A) dart mode
pub run test test\my_test.dart
00:00 +1: All tests passed!
case B) javascript mode pub run test -pchrome test\my_test.dart
00:00 +0 -1: trivial test
Expected: '{"key1":"val1"}'
Actual: '{"key1":{}}'
Which: is different.
Expected: {"key1":"val1"}
Actual: {"key1":{}}
^
Differ at offset 8
package:test Object.expect
test\my_test.dart 13:5 main.<fn>
00:00 +0 -1: Some tests failed.
I think it's a problem with serialize. In dartson.dart _serializeMap(Map object):
Can you please show your pubspec. Dartson with dart2js should no longer use mirrors and instead use the transformer. It looks like you don't have the transformer set up properly.
OMG! You're right. At some point by mistake I changed the transformer configuration.
Thanks so much for your help
I upgraded to sdk 1.23 (from 1.19) and dartson is not working after dart2js compiling.
Compiler displays this warning: