ethanblake4 / dart_eval

Extensible Dart interpreter for Dart with full interop
https://pub.dev/packages/dart_eval
BSD 3-Clause "New" or "Revised" License
334 stars 40 forks source link

Method not found containsKey on Map #147

Closed cuifengcn closed 1 year ago

cuifengcn commented 1 year ago
final testMap = {'default': ''};
print(testMap.containsKey('default'));

When starting compile, it has this error

flutter: │ ⛔ CompileError: Method not found containsKey on Map at "testMap.containsKey(..." (file package:example/main.dart)
flutter: │ ⛔ #0      Compiler.compileSources (package:dart_eval/src/eval/compiler/compiler.dart:497:7)
flutter: │ ⛔ #1      Compiler.compile (package:dart_eval/src/eval/compiler/compiler.dart:164:12)

dart_eval 0.7.1

DeleMike commented 1 year ago

Hi @ethanblake4 and @cuifengcn,

I would love to work on this issue. Can you elaborate more on what it entails?

ethanblake4 commented 1 year ago

@DeleMike Sure, this is a great place to start on dart_eval as it just involves making standard library bindings. I'd recommend reviewing this PR to see an example of some functions that were added to List and Iterable. In this case you'd be adding the function containsKey to $Map in map.dart.

ethanblake4 commented 1 year ago

Released in v0.7.2