Comments (3)
Indeed, exception handling in general is not really supported yet in dart_eval. I haven't yet had a chance to write down my thoughts on this yet, so I'll put everything here that I believe needs to be done to get this to work:
- Annotate values with runtime type sets at function & field boundaries
- Support runtime type-tests (ie. the
is
keyword) - Catch all errors at bridge entry boundaries in the runtime
- Add a catch stack with runtime-type annotated entries, and bytecode ops to push/pop to/from the catch stack
- Add bridge bindings for Exception and StackTrace
- Add a bytecode throw op that iterates backwards through the call, scope, and catch stacks, appending scope entries to the stack trace until it a ) finds a bridge exit boundary, at which point it will actually throw or b) finds a matching catch boundary, at which point it will resume program execution there with the synthesized stack trace
- Support try/catch and throw in the compiler, including for statement flow analysis
- (later) support rethrow in the compiler
- (later) support the Never type somehow
- (later) line number annotation data for stack traces
As you can probably tell, this is kind of a massive undertaking which is why I've been putting it off. It's definitely high on my list of priorities though!
from dart_eval.
Partial support added in v0.6.0. Leaving this open until the implementation is spec-compliant.
from dart_eval.
Closing as this is effectively complete in v0.7.0, including rethrow
. Still may need some minor tweaks and fixes in later versions.
from dart_eval.
Related Issues (20)
- type 'VariableDeclarationImpl' is not a subtype of type 'MethodDeclaration' in type cast
- constructor logic not work HOT 1
- Work with <String, String>{} returns exception type 'String' is not a subtype of type '$Value' of 'key' HOT 2
- Does it support Singleton pattern??? HOT 3
- Could not find declaration "File" at unknown (file package:example/main.dart) HOT 8
- Unnecessary casting
- what is the difference between $int($value.hashCode) and __hashCode ? HOT 9
- type 'BridgeEnumDef' is not a subtype of type 'BridgeClassDef' in type cast
- Null check operator used on a null value HOT 1
- how to write a wrapper for TopLevelVariableDeclaration? HOT 2
- CompileError: Unknown method dynamic.read at "ref.read(1)"
- Null check operator used on a null value
- Cannot access null value from map
- How to write a Wrapper for extension?
- Support short-circuit evaluation for && operator HOT 3
- Add support for functions that returns List<UserModel>
- Add support for string & some math functions like toStringAsFixed, abs(), double.infinity
- Multiple ( ? ) null check operator in nested optional object - not work.
- Kindly add support methods like fold, contains in List<Some>
- kindly add support for Spread Operator (...)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart_eval.