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.
--
Please post a minimal code sample demonstrating the problem, and I will
take a look.
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
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.
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?
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.
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.
Cool, thanks for researching.