Fluorine icon indicating copy to clipboard operation
Fluorine copied to clipboard

Debug message should come with correct function name for extending contexts

Open snowmantw opened this issue 11 years ago • 1 comments

Every function in contexts optionally has its own name, and it will be printed in debug mode. But if we extend a new context from the existing one, those functions not be extended will use the name given in the basic context when we called them. For example:

IO.get          --> New function come without any problem
IO.initialize() --> Not extended; will call Context.initialize()
IO.run( )       --> Extended; will display its name

If we create a chain like this and execute it:

IO("/resource/manifest.json").get( ).done( )( )

The debug messages will be like:

[DEBUG] Process executing step #0, step name(if any): Context::initialize ( call with ), [] 
[DEBUG] Process executing step #1, step name(if any): IO::run ( call with ), ["/resource/manifest.json"]
// ....

The #0 step, which actually calls the Context::initialize, should be corrected with IO::initialize, which is more useful for debugging.

snowmantw avatar Aug 07 '13 01:08 snowmantw

This issue can be solved by separating function name an the context's name, which currently are combined in the same string to display. And the debugger can get and print out the context name, then the function name. In this way we need to

  • add context name field to every context
  • modify the debugger to fetch and get context names
  • modify existing function name
  • test extended contexts to see if works

snowmantw avatar Aug 07 '13 02:08 snowmantw