Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date.now() expression returns incorrect result #34

Closed
Taritsyn opened this issue Jan 2, 2018 · 3 comments
Closed

Date.now() expression returns incorrect result #34

Taritsyn opened this issue Jan 2, 2018 · 3 comments
Assignees

Comments

@Taritsyn
Copy link
Contributor

Taritsyn commented Jan 2, 2018

Hello!

After upgrading to version 5.5.1, V8ScriptEngine.Evaluate method began to return an incorrect result of the Date.now() expression. Current result (16336909) differs significantly from the result of version 5.5.0 (1514915269409).

For verification, you can use the following code:

using System;
using Microsoft.ClearScript.V8;

namespace TestClearScript
{
	class Program
	{
		static void Main(string[] args)
		{
			using (var engine = new V8ScriptEngine())
			{
				double totalMilliseconds = Convert.ToDouble(engine.Evaluate("Date.now();"));
				Console.WriteLine("totalMilliseconds = {0}", totalMilliseconds);
			}
		}
	}
}
@ClearScriptLib ClearScriptLib self-assigned this Jan 2, 2018
@ClearScriptLib
Copy link
Collaborator

Confirmed. Thanks, Andrey!

Unlike the previous stable version, V8 6.3 calls the host to read the wall clock, and ClearScript's implementation of that callback is broken. We'll post a fix shortly.

Thanks again!

@ClearScriptLib
Copy link
Collaborator

Fixed in Version 5.5.1.1.

@Taritsyn
Copy link
Contributor Author

Taritsyn commented Jan 3, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants