Comments (10)
@aruneshchandra What's expected behavior?
@boingoing Do you happen to know about this?
Thanks!
from node-chakracore.
Async functions return a Promise when called. Do you get the same error with something like Promise.resolve()
?
from node-chakracore.
@targos - Yes
from node-chakracore.
I'm not familiar with REPL but looks like util.js is using the mirror debugger to inspect the promise instance. It may be probing for internal promise state. I don't have experience with it. Looks like the API is Debug.MakeMirror. Perhaps this is not supported yet.
@kunalspathak Do you have context on this?
from node-chakracore.
Yes, MakeMirror is a v8 specific debugging API that node uses to inspect the properties of an object and Chakracore doesn't have the implementation of it yet.
Sent from Outlook Mobilehttps://aka.ms/blhgte
On Mon, Mar 21, 2016 at 3:18 PM -0700, "Taylor Woll" <[email protected]mailto:[email protected]> wrote:
I'm not familiar with REPL but looks like util.js is using the mirror debugger to inspect the promise instance. It may be probing for internal promise state. I don't have experience with it. Looks like the API is Debug.MakeMirror. Perhaps this is not supported yet.
@kunalspathakhttps://github.com/kunalspathak Do you have context on this?
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-199513901
from node-chakracore.
Thanks for these info! I prototyped a fake Debug.MakeMirror support to make this look nicer:
> async function foo() { }
undefined
> foo()
Promise { undefined }
> foo().then(function() { console.log("done") })
Promise { undefined }
> done
>
Currently I can only get "Promise { undefined }" disregarding real status (pending, resolved, ...). If we have APIs to inspect Promise internal states, we could improve this. Do we have any way to inspect? @boingoing
@aruneshchandra Would you like this to get in?
from node-chakracore.
@jianchun The engine tracks internal promise states but they aren't exposed via any Jsrt API. It shouldn't be too hard to add one. The fields you're interested in are JavascriptPromise::status and JavascriptPromise::result, I think.
from node-chakracore.
Having the real fix backed by the new JsRT api will be ideal, however I think we should take the current fix. Also it would be nice to show Promise { unknown }
which seems more accurate in this case.
from node-chakracore.
@aruneshchandra Changed to
> async function foo() {}
undefined
> foo()
Promise { '<unknown>' }
> foo().then(()=>console.log('done'))
Promise { '<unknown>' }
> done
>
@agarwal-sandeep @liminzhu How will we inspect a Promise object from a debugger? Specifically need to access its "status" and "result" as @boingoing said.
from node-chakracore.
Sweet - thanx @jianchun !
from node-chakracore.
Related Issues (20)
- Building fails HOT 2
- SharedArrayBuffers can cause crashes when inspected in certain ways HOT 3
- `test-dgram-*` test failures on macOS
- Problems while building against node-chakracore master
- Wire up `resourceNameToUrl` support in inspector
- node-gyp errors installing `npm i sleep` with [email protected] and [email protected]
- Problems installing `npm i sleep` with node-chakracore 10.13.0. HOT 3
- Is this project affected by Edge’s move to Chromium? HOT 2
- --v8-options not working HOT 3
- Failed unit tests running node-ChakraCore on Windows IoT
- Issues with N-API Addon and TTD
- ttdReplayDebugUri not initialised
- TTD does not initialize properly HOT 1
- Need support for the 3 dots operator to install tensorflow/tfjs-node HOT 2
- Upgrade to node v8 7.4 which support JIT-less
- azure-sdk-js setup hits Error: The command failed with exit code 1
- napi: napi version doesn't been exposed through process.versions
- Build fails, "error: ‘vector’ in namespace ‘std’ does not name a template type" etc HOT 2
- ContextShim is leaking
- Current Status? HOT 2
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 node-chakracore.