Giter VIP home page Giter VIP logo

Comments (3)

ethanblake4 avatar ethanblake4 commented on August 18, 2024 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.

ethanblake4 avatar ethanblake4 commented on August 18, 2024

Partial support added in v0.6.0. Leaving this open until the implementation is spec-compliant.

from dart_eval.

ethanblake4 avatar ethanblake4 commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.