On Thu, Sep 17, 2020 at 12:13 AM Yao Xiao <yao...@chromium.org> wrote:
>
> Thanks for the pointer Ben. I encountered another issue while following your 
> suggestion:
>
> For evaluating the script "new Promise(() => {})", I'd expect 
> result->IsPromise() is true. However, in some cases I'm seeing 
> result->IsPromise() is false if some code are executed before.
>
> I don't have a small example as I couldn't pinpoint the issue. But I'll see 
> this issue if I execute the tensorflow.js source code (from 
> https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.4.0/dist/tf.js) before the 
> promise, in which case I'll see result->IsPromise() is false. However, when I 
> print the status from v8::String::Utf8Value(isolate, 
> result->ToDetailString(context).ToLocalChecked()), it still outputs 
> "#<Promise>". So I'm confused.
>
> It seems that the execution of tensorflow.js is interfering with something, 
> but I'm not sure how to debug. FYI, I *think* the execution of tensorflow.js 
> succeeded, because I saw no compile/run error, and after that I could still 
> compile/run some tensorflow functions, or just compile/run some other toy 
> functions. It's just that a promise is no longer evaluated to be a promise.
>
> Any ideas why this happens?

The file you link to seems to have its own custom Promise
implementation, something that the spec allows (search for
'thenables'.)

You can't really detect that except by checking if it's a thenable (an
object with a .then method) and hope for the best.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/CAHQurc90VC8tkwk0_hpgQQ9H2qumXh8YefmVe0siVW_N-1RNzQ%40mail.gmail.com.

Reply via email to