Replies: 1 comment
-
Awesome work! It does seem I've confused you a bit though haha. There are actually two separate types of compile-time bindings in dart_eval, the standard "bridge" bindings and the legacy "known method" bindings in Try removing that known method stuff and let me know how it goes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi again,
For convenience: https://api.dart.dev/stable/2.18.2/dart-convert/dart-convert-library.html
I've referenced 3cb310c and c58466b when trying to bridge the
dart:convert
library.So far I've managed to import the library and instantiate a
JsonCodec
instance, however, I still don't seem to be able to use any functions as I'm getting theNull check operator
error. My most likely assumption is that I've done something wrong withinEvalTypes
from thebuiltins.dar
t file.You can track most of what I've done so far via this commit, I'm trying to use both
encode
anddecode
functions on theJsonEncode
object which I've:lib/src/eval/shared/stdlib/convert/json_codec.dart
Declared through
methods
parameter. I am missing some optional parameters, but I've assumed that wouldn't cause any issues.lib/src/eval/shared/stdlib/convert/json_codec.dart
Declared them within $getProperty override
lib/src/eval/compiler/builtins.dart
Included a new
int
value fordartConvertFile
, I've assumed it doesn't have to be any actual value, however, I am seeing some code in thelib/src/eval/compiler/type.dart
file which referencesdartCoreFile
specifically. At this point, I'm assuming I've done something wrong in that I haven't taken into account the difference between primitive types and the new type I'm trying to introduce.Added the
JsonCodec
type withincoreDeclarations
andknownMethods
objects and as there appears to be a fallback tocoreDeclarations
incompiler.dart
line 219 and 223.'JsonCodec': EvalTypes.jsonCodecType,
static const TypeRef jsonCodecType = TypeRef(dartConvertFile, 'JsonCodec', extendsType: objectType, resolved: true);
Code sample
Logs
From what I've gathered, the error is most likely somewhere in the
EvalTypes
class and is preventing me from setting the methods properly. As no required parameters had been left out, I've assumed the bindings should work, due to the "limited support" bit.Any input into errors or on further adjustments would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions