What problem are you trying to solve?
There is currently syntax to specify a default value empty sequence (= []) and a default value default dictionary (= {}), but no way to specify a default value empty record<K, V>.
This is needed to eliminate the invalid syntax used by WebGPU's GPUDeviceDescriptor, which tries to the default dictionary ( = {}) to default initialize the record<K, V> member requiredLimits:
dictionary GPUDeviceDescriptor
: GPUObjectDescriptorBase {
sequence<GPUFeatureName> requiredFeatures = [];
record<DOMString, (GPUSize64 or undefined)> requiredLimits = {};
GPUQueueDescriptor defaultQueue = {};
};
(I have also filed gpuweb/gpuweb#5529 on WebGPU to remove the invalid syntax).
What solutions exist today?
Today, one can use prose for this.
How would you solve it?
Make either = [] or = {} valid for record<K, V>.
What problem are you trying to solve?
There is currently syntax to specify a default value empty
sequence(= []) and a default value defaultdictionary(= {}), but no way to specify a default value emptyrecord<K, V>.This is needed to eliminate the invalid syntax used by WebGPU's GPUDeviceDescriptor, which tries to the default
dictionary(= {}) to default initialize therecord<K, V>member requiredLimits:dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { sequence<GPUFeatureName> requiredFeatures = []; record<DOMString, (GPUSize64 or undefined)> requiredLimits = {}; GPUQueueDescriptor defaultQueue = {}; };(I have also filed gpuweb/gpuweb#5529 on WebGPU to remove the invalid syntax).
What solutions exist today?
Today, one can use prose for this.
How would you solve it?
Make either
= []or= {}valid forrecord<K, V>.