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

Bug with js indexer, when index equals 0x0 #710

Closed
maxkatz6 opened this issue Mar 10, 2020 · 3 comments · Fixed by #711
Closed

Bug with js indexer, when index equals 0x0 #710

maxkatz6 opened this issue Mar 10, 2020 · 3 comments · Fixed by #711
Labels

Comments

@maxkatz6
Copy link

Minimal repro

  1. Create new console project (netcoreapp3.1 in my case)
  2. Add reference to Jint, version = 3.0.0-beta-1715 (which is latest in my case)
  3. Put code below into Main method:
var shouldBe1 = new Jint.Engine().Execute("var t = '1234'; var a = t[0x0]").GetValue("a");
Console.WriteLine(shouldBe1);
Console.ReadLine();

Expected result: "1"
Actual result: undefined

In the chrome devtool`s console I can see expected result with same JS code.
With '[0]' instead '[0x0]' everything works as expected.

@maxkatz6
Copy link
Author

Any other hex value work as expected.

var t = '1234'; var a = t[0x1];

Expected result: "2"
Actual result: "2"

So problem exists only with [0x0]

@lahma
Copy link
Collaborator

lahma commented Mar 10, 2020

Thanks for reporting this, I've prepared a PR that should fix the issue #711 .

@maxkatz6
Copy link
Author

@lahma thanks!

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

Successfully merging a pull request may close this issue.

2 participants