Comments (11)
@captainbrosset thanks, sent you an email.
from devtools.
Hi just tested on Edge Canary 128.0.2709. Everything looks good including the code logic.
from devtools.
Thank you for reporting this here. I have two questions:
- Does the bug only appear in the DevTools Console? That is: the value appears as
undefined
in the Console, but the code works. - Are you able to provide a full code snippet for us to try and reproduce this locally? Right now, the code is incomplete and I can't really run it locally without inventing other parts of the code, which might not be the right ones to reproduce the issue.
Thank you.
from devtools.
@captainbrosset Hi,
-
No, the DevTool tooltip is the only place where the should-be value shows up. However, the "real" value is still
undefined
, making myif
statement's expressionfalse
when it should betrue
. That is, the code doesn't perform as it should. -
I sent it to the person at this post privately because it's a private project. Unfortunately I am not sure what causes it and cannot make a minimal reproducible example. If you provide a private channel I will send over the file.
from devtools.
@datvm if you can, please send the file over as a private message either on my twitter or mastodon account, which are linked to from my github account page: https://github.com/captainbrosset/
Or send it as an email: patrickbrosset at gmail dot com.
from devtools.
Thank you @datvm. It took me a bit of time, but I did find a reduced test case. This has nothing to do with your specific extension code, but instead seems to be a bug with the way DevTools evaluates private properties.
Here is the reduced test case:
<!DOCTYPE html>
<script>
class Foo {
#bar = 1;
constructor () {
console.log(this.#bar);
debugger;
}
}
new Foo();
</script>
When you run this, the console shows 1
, as expected, because of the console.log
statement. Also, hovering over the this.#bar
expression in the Sources tool shows the right value. But, when evaluating this.#bar
in the Console tool, the result is undefined
. See below:
![image](https://private-user-images.githubusercontent.com/1152698/345377101-7761936e-6c75-4d7e-bcd8-041f60700173.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMjQ2MzEsIm5iZiI6MTcyMTIyNDMzMSwicGF0aCI6Ii8xMTUyNjk4LzM0NTM3NzEwMS03NzYxOTM2ZS02Yzc1LTRkN2UtYmNkOC0wNDFmNjA3MDAxNzMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTdUMTM1MjExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTM5ZGJiZWM1OWU1MGFlOWNlOGQxMTQ0NzI0OTNkYzg4NjM4NmNhNTM0MjJjNTRjNzMyNTdjMzkyYmYwYjFlOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.E0LtI2SER6w8RUe4KKMDT1DCcwhl4ZjIeImBrNH34lc)
I was also able to verify that this worked fine in Chrome, just not in Edge.
I'll bring this up with our dev team and make sure the bug is tracked on our backlog. Thank you for filing.
from devtools.
@captainbrosset Hi, thank you for the info. Please note that in your code, the issue only happens to the printed out Console, however, in my extension code, the whole expression actually gets evaluated incorrectly. For example, I added an if
statement to your code:
class Foo {
#bar = 1;
constructor () {
console.log(this.#bar);
if (this.#bar < 2) {
console.log("< 2");
}
debugger;
}
}
new Foo();
In the above code, the if
expression is still evaluated correctly and < 2
is printed out even though this.#bar
is printed out as undefined
. In my extension code, the whole if
statement is skipped due to undefined
being falsy.
from devtools.
That is very surprising. If there's indeed an issue with the running code (whether DevTools is opened or not), then that is a different bug with the V8 scripting engine. What's surprising is that we use the exact same as Chrome does. So I don't expect there to be any differences.
Note that the DevTools bug (undefined
showing up in the Console) is being investigated by our dev team, and they've identified the root cause.
I suggest waiting for a fix to make it to the next Edge Canary, and then test again to see if your issue goes away.
from devtools.
@captainbrosset Maybe an issue when the method is async
? As for my extension, the code in question is this:
if (now - this.#lastDownload < addDelay) {
await sleepAsync(now - this.#lastDownload);
}
In Edge, my tasks all ran at the same time without delay (that's why I used DevTools to inspect the issue to begin with). I am 90% sure the issue happens without DevTools being opened.
In Chrome, the tasks are correctly delayed.
from devtools.
@datvm would you have time to test something please?
Our dev team tells me they've addressed the bug where the value appears as undefined in the Console.
So, if you have some time, please make sure you have Microsoft Edge Canary 128.0.2706.0 (or later) and test your scenario again.
I'm curious to learn how it impacts your issue.
from devtools.
Great to hear. Thanks for testing. Closing this issue now.
from devtools.
Related Issues (20)
- Wrong FR translation in DevTools HOT 1
- Debugger pausing on ignore listed files HOT 5
- how to modify devtools UI font? HOT 3
- Issue with retrieving sourcemaps from symbol server: "Unknown error requesting source map: Failed to fetch" HOT 3
- New JSON Viewer is changing the JSON serialized value for some numbers HOT 6
- Always syncing CSS changes in the Styles pane HOT 6
- Emulated devices get Edg appended to their user agent when dev tools are opened HOT 1
- Dyslexia-friendly front and text-to-speech capability HOT 3
- [Request feature] Json viewer HOT 2
- [JSON viewer] Make JSON data editable HOT 3
- Sticky favorites and sticky pinned tabs that show in all workspaces HOT 2
- Error playing TIKTOK videos HOT 1
- New Edge version 125, DevTools - Application tab make browser crash HOT 8
- YouTube Livestream chat load super slow on Edge HOT 1
- JSON Viewer - window.getSelection() not returning full text selection for browser extension HOT 1
- 新标签页出现错误弹窗 HOT 1
- Unexpected Gray Border and Incorrect Width in Fullscreen Mode with DevTools Open in Edge HOT 1
- Dev Tools override on a domain caused response 'true' to be parsed incorrectly HOT 1
- Windows Notification Service endpoints for Web Push are down HOT 1
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 devtools.