Skip to content

Commit

Permalink
Fix idlharness.js' handling of Float(32/64)Array types
Browse files Browse the repository at this point in the history
idlharness.js does not seem to correctly handle Float32Array and
Float64Array types. When an interface uses such types, the tests will
fail with the exception thrown from idlharness.js:1221:
`throw new IdlHarnessError("Unrecognized type " + type);`

The fix is to teach idlharness.js how to handle Float(32/64)Array types,
and, while at it, to teach it to handle other typed arrays.

Bug: 1074548
Change-Id: I549f6ae1ea13590207bd4f49b94439ad2a43a13d
  • Loading branch information
bialpio authored and chromium-wpt-export-bot committed Apr 29, 2020
1 parent c07deab commit da99c52
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion resources/idlharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ IdlArray.prototype.is_json_type = function(type)
case "Uint32Array":
case "Uint8ClampedArray":
case "Float32Array":
case "Float64Array":
case "ArrayBuffer":
case "DataView":
case "any":
Expand Down Expand Up @@ -1207,8 +1208,18 @@ IdlArray.prototype.assert_type_is = function(value, type)
assert_regexp_match(value, /^([\x00-\ud7ff\ue000-\uffff]|[\ud800-\udbff][\udc00-\udfff])*$/);
return;

case "Int8Array":
case "Int16Array":
case "Int32Array":
case "Uint8Array":
case "Uint16Array":
case "Uint32Array":
case "Uint8ClampedArray":
case "Float32Array":
case "Float64Array":
case "ArrayBuffer":
case "DataView":
assert_equals(typeof value, "DataView");
assert_true(value instanceof self[type], "wrong type: not a " + type);
return;

case "object":
Expand Down

0 comments on commit da99c52

Please sign in to comment.