java_geek
java_geek

Reputation: 18035

Debugging Chrome Javascript engine source code from Developer Tools

I have some sample JS code that I am running in the browser and it uses Promise. I would like to debug the source code of the JS engine along with debugging my source code. Is there a way I can attach the JS engine source code in chrome developer tools?

UPDATE:

 const buyFlightTicket = () => {
        return new Promise((resolve, reject) => {
            setTimeout(() => {
                const error = false;
                if (error) {
                    reject("Sorry your payment was not successful")
                } else {
                    resolve("Thank you, your payment was successful");
                }
            }, 3000)
        })
    }
    buyFlightTicket()
        .then((success) => console.log(success))
        .catch((error) => console.log(error));

I have this piece of code and I want to understand what the Promise() function is doing with the function I am passing it as argument

Upvotes: 0

Views: 324

Answers (1)

jmrk
jmrk

Reputation: 40491

V8 developer here. To debug V8 itself, you need a C++ debugger (like GDB or LLDB or Visual Studio's debugger), along with a Debug build of Chrome or V8. Chrome DevTools can't debug V8's internals.

Upvotes: 1

Related Questions