mirror of
https://github.com/servo/servo.git
synced 2025-06-27 10:33:39 +01:00
Update web-platform-tests to revision b704e37ec97fe90b3a3d59c10f78c21907b5b576
This commit is contained in:
parent
cc0ac89e1a
commit
9f516d3717
70 changed files with 1688 additions and 806 deletions
|
@ -50,6 +50,14 @@ function any_initial_value(syntax) {
|
|||
// generated. If a single string is used as the argument, it is assumed to be
|
||||
// the syntax.
|
||||
function generate_property(reg) {
|
||||
// Verify that only valid keys are specified. This prevents the caller from
|
||||
// accidentally supplying 'inherited' instead of 'inherits', for example.
|
||||
if (typeof(reg) === 'object') {
|
||||
const permitted = new Set(['name', 'syntax', 'initialValue', 'inherits']);
|
||||
if (!Object.keys(reg).every(k => permitted.has(k)))
|
||||
throw new Error('generate_property: invalid parameter');
|
||||
}
|
||||
|
||||
let syntax = typeof(reg) === 'string' ? reg : reg.syntax;
|
||||
let initial = typeof(reg.initialValue) === 'undefined' ? any_initial_value(syntax)
|
||||
: reg.initialValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue