MCPcopy Create free account
hub / github.com/nodejs/node / TestGeneralAccessors

Function TestGeneralAccessors

deps/v8/test/mjsunit/harmony/dataview-accessors.js:396–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394TestOutOfRange();
395
396function TestGeneralAccessors() {
397 var a = new DataView(new ArrayBuffer(256));
398 function CheckAccessor(name) {
399 var f = a[name];
400 assertThrows(function() { f(); }, TypeError);
401 f.call(a, 0, 0); // should not throw
402 assertThrows(function() { f.call({}, 0, 0); }, TypeError);
403 f.call(a);
404 f.call(a, 1); // should not throw
405 }
406 CheckAccessor("getUint8");
407 CheckAccessor("setUint8");
408 CheckAccessor("getInt8");
409 CheckAccessor("setInt8");
410 CheckAccessor("getUint16");
411 CheckAccessor("setUint16");
412 CheckAccessor("getInt16");
413 CheckAccessor("setInt16");
414 CheckAccessor("getUint32");
415 CheckAccessor("setUint32");
416 CheckAccessor("getInt32");
417 CheckAccessor("setInt32");
418 CheckAccessor("getFloat32");
419 CheckAccessor("setFloat32");
420 CheckAccessor("getFloat64");
421 CheckAccessor("setFloat64");
422}
423
424TestGeneralAccessors();
425

Callers 1

Calls 1

CheckAccessorFunction · 0.85

Tested by

no test coverage detected