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

has a bug #7

Closed
SamuelZon258 opened this issue Jan 16, 2019 · 4 comments
Closed

has a bug #7

SamuelZon258 opened this issue Jan 16, 2019 · 4 comments

Comments

@SamuelZon258
Copy link

let obj = serializeMsgPack([100, 100, "ok", serializeMsgPack([[100, 1000.01]])]
let obj2 = deserializeMsgPack(obj)
console.log(deserializeMsgPack(obj2[3])[0][1]);// print:5.262076770253218e+228

@ygoe
Copy link
Owner

ygoe commented Jan 17, 2019

I can't follow your code and it contains syntax errors. Here's a cleaned up version of it:

let obj1 = [[100, 1000.01]];
let msg1 = serializeMsgPack(obj1);
let obj2 = [100, 100, "ok", msg1];
let msg2 = serializeMsgPack(obj2);

let obj2_ = deserializeMsgPack(msg2);
let msg1_ = obj2[3];
let obj1_ = deserializeMsgPack(msg1_);

console.log(obj1_[0][1]); // 5.262076770253218e+228

Can you please verify the correctness of my version and that it still produces the wrong result for you? Because this code works as expected for me in Firefox 64 on Windows 10.

If the error remains for you, please specify what environment you used.

@SamuelZon258
Copy link
Author

chrome 72.0.3626.119(64 bit) for Mac

@SamuelZon258
Copy link
Author

            console.log("r");
	let obj1 = [[100, 1000.01]];
	let msg1 = serializeMsgPack(obj1);
	let obj2 = [100, 100, "ok", msg1];
	let msg2 = serializeMsgPack(obj2);

	let obj2_ = deserializeMsgPack(msg2);
	let msg1_ = obj2_[3];
	let obj1_ = deserializeMsgPack(msg1_);

	console.log(obj1_[0][1]); // 5.262076770253218e+228

log:
r
5.262076770253218e+228

@ygoe
Copy link
Owner

ygoe commented Feb 26, 2019

Sorry, I can't reproduce this. The closest environment I have is Chrome 72.0.3626.109 (64 bit) on Windows 10. For me, the log prints the expected "1000.01", as it does in Firefox. So I'd suggest you report the bug in Chrome for Mac.

@ygoe ygoe closed this as completed Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants