Code Monkey home page Code Monkey logo

Comments (5)

tishion avatar tishion commented on May 25, 2024 1

can review this commit: aa4b742

from cefviewcore.

tishion avatar tishion commented on May 25, 2024

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.

ShelleyLake avatar ShelleyLake commented on May 25, 2024

Thanks.

from cefviewcore.

ShelleyLake avatar ShelleyLake commented on May 25, 2024

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.

tishion avatar tishion commented on May 25, 2024

uhm..... I think you are correct...will draft a fix

from cefviewcore.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.