Issue 19 in google-js-test: Support for ArrayBuffer and TypedArrays

11 views
Skip to first unread message

google-...@googlecode.com

unread,
Jan 18, 2012, 11:28:58 AM1/18/12
to google-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 19 by arunjits...@gmail.com: Support for ArrayBuffer and
TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

What steps will reproduce the problem?
1. Write code that uses ArrayBuffer or a TypedArray.
2. Write tests.
3. Execute tests.

What is the expected output? What do you see instead?
Expect tests to get executed. Instead, all tests fail because ArrayBuffer
is not defined.
[ReferenceError: ArrayBuffer is not defined]

What version of the product are you using? On what operating system?
gjstest v1.0.6, Mac OS X 10.7.2

Please provide any additional information below.
--

google-...@googlecode.com

unread,
Jan 18, 2012, 4:35:37 PM1/18/12
to google-...@googlegroups.com

Comment #1 on issue 19 by jaco...@google.com: Support for ArrayBuffer and
TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

Please post a minimal code sample demonstrating the problem, and I will
take a look.

google-...@googlecode.com

unread,
Jan 19, 2012, 12:49:59 AM1/19/12
to google-...@googlegroups.com

Comment #2 on issue 19 by arunjits...@gmail.com: Support for ArrayBuffer
and TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

function encode(bytes) {
if (bytes instanceof ArrayBuffer) {
bytes = new Uint8Array(bytes);
}
// ..
}


The actual code is available at https://github.com/arunjitsingh/base64.
The error is raised in this file:
https://github.com/arunjitsingh/base64/blob/master/base64.js#L50

google-...@googlecode.com

unread,
Jan 19, 2012, 1:00:01 AM1/19/12
to google-...@googlegroups.com
Updates:
Status: WontFix

Comment #3 on issue 19 by jaco...@google.com: Support for ArrayBuffer and
TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

gjstest supports whatever v8 does. I can't find any definitive answer
online, but it seems v8 doesn't support ArrayBuffer (yet?). Let me know if
you find otherwise, and consider filing a v8 bug instead.

google-...@googlecode.com

unread,
Jan 19, 2012, 2:40:19 AM1/19/12
to google-...@googlegroups.com

Comment #4 on issue 19 by arunjits...@gmail.com: Support for ArrayBuffer
and TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

I'm quite sure that v8 supports ArrayBuffer and TypeArrays. Chrome, which
uses v8, has support in the latest stable release... Does gjstest build its
own v8, or can it use the system's v8?

google-...@googlecode.com

unread,
Jan 19, 2012, 4:33:20 AM1/19/12
to google-...@googlegroups.com

Comment #5 on issue 19 by jaco...@google.com: Support for ArrayBuffer and
TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

It uses whatever v8 library you have installed (in /usr/local/lib, or
wherever). I also see that Chrome supports it, but I can't find a clear
explanation online of whether it's part of the JS engine proper, or part of
WebGL, HTML5, or something else that's not strictly bare JS. So I'm not
sure if it's missing because my system v8 and yours are older than the one
in Chrome or because it's not part of v8 proper.

As I said, let me know if you can find some clearer documentation or a v8
changeset that adds it or anything like that.

google-...@googlecode.com

unread,
Jan 19, 2012, 5:59:03 AM1/19/12
to google-...@googlegroups.com

Comment #6 on issue 19 by arunjits...@gmail.com: Support for ArrayBuffer
and TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

Got it. I dug into v8's source and compared it against WebKit's. It seems
that ArrayBuffer and co. aren't part of the native language, but added on
over it (different browser engines implement and optimize these
differently). So, this bug can remain closed.

google-...@googlecode.com

unread,
Jan 19, 2012, 3:54:27 PM1/19/12
to google-...@googlegroups.com

Comment #7 on issue 19 by jaco...@google.com: Support for ArrayBuffer and
TypedArrays
http://code.google.com/p/google-js-test/issues/detail?id=19

Cool, thanks for researching.

Reply all
Reply to author
Forward
0 new messages