Comments (5)
can review this commit: aa4b742
from cefviewcore.
I remember this comment was added by fixing the issue (#10).
And after debugging, I found there is mistake in this comment.
Just try the code below:
auto v = CefV8Value::CreateInt(1000);
auto isDouble = v->IsDouble();
logD("isDouble: %d", isDouble); // true
auto isUnint = v->IsUInt();
logD("isUnint: %d", isUnint); // true
auto isInt = v->IsInt();
logD("isInt: %d", isInt); // true
And also, there is a bug in the executeJavascriptWithResult method, I am fixing it now.
from cefviewcore.
Thanks.
from cefviewcore.
Argh! My bad. If I understand correctly in Javascript there is only one value (V8Value) of type "Number" stored as float.
https://www.w3schools.com/js/js_numbers.asp
So that's probably why "1000" will always give true in all three conditions: technically it's a "double", but it can be converted to "uint" and "int".
Excuse me, but if that is the case I see a problem with the order of your conditions: if isDouble()
is always "true", this prevents the other conditions isUint()
, is Int()
from being reached.
So wouldn't it make sense to check the value in the order: isUint(), isInt(), isDouble()
?
from cefviewcore.
uhm..... I think you are correct...will draft a fix
from cefviewcore.
Related Issues (12)
- CefViewBrowserClient.cpp的228行 auto context = arguments->GetDouble(0); 无法获取到context的值。 HOT 2
- Looking some help for MacOS HOT 2
- Cef version selection HOT 1
- http://opensource.spotify.com/cefbuilds/index.html is not available HOT 1
- 111.2.7+gebf5d6a+chromium-111.0.5563.148 / Chromium 111.0.5563.148版本支持 HOT 2
- Build break with cef91 HOT 1
- Drag and drop event problem HOT 8
- Maybe error platform macro HOT 1
- CefDownloadHandler HOT 2
- CefViewWing cannot start
- is there any win32 demo without qt deps 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 cefviewcore.