Bug 1950703 - Add back record default values, r=Standard8
This makes it so you can call `SomeRecord()` to get a record with all undefined fields. For example, `test_ronpoint.js` calls `new OptionneurDictionnaire()`. Differential Revision: https://phabricator.services.mozilla.com/D239795
This commit is contained in:
@@ -794,7 +794,7 @@ export class FfiConverterTypeRelevancyStore extends FfiConverter {
|
||||
* BanditData
|
||||
*/
|
||||
export class BanditData {
|
||||
constructor({ bandit, arm, impressions, clicks, alpha, beta }) {
|
||||
constructor({ bandit, arm, impressions, clicks, alpha, beta } = { bandit: undefined, arm: undefined, impressions: undefined, clicks: undefined, alpha: undefined, beta: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(bandit)
|
||||
} catch (e) {
|
||||
@@ -982,7 +982,7 @@ export class FfiConverterTypeBanditData extends FfiConverterArrayBuffer {
|
||||
* rounding. This is to make them compatible with Glean's distribution metrics.
|
||||
*/
|
||||
export class InterestMetrics {
|
||||
constructor({ topSingleInterestSimilarity, top2interestSimilarity, top3interestSimilarity }) {
|
||||
constructor({ topSingleInterestSimilarity, top2interestSimilarity, top3interestSimilarity } = { topSingleInterestSimilarity: undefined, top2interestSimilarity: undefined, top3interestSimilarity: undefined }) {
|
||||
try {
|
||||
FfiConverterU32.checkType(topSingleInterestSimilarity)
|
||||
} catch (e) {
|
||||
@@ -1101,7 +1101,7 @@ export class FfiConverterTypeInterestMetrics extends FfiConverterArrayBuffer {
|
||||
* number of elements.
|
||||
*/
|
||||
export class InterestVector {
|
||||
constructor({ inconclusive, animals, arts, autos, business, career, education, fashion, finance, food, government, hobbies, home, news, realEstate, society, sports, tech, travel }) {
|
||||
constructor({ inconclusive, animals, arts, autos, business, career, education, fashion, finance, food, government, hobbies, home, news, realEstate, society, sports, tech, travel } = { inconclusive: undefined, animals: undefined, arts: undefined, autos: undefined, business: undefined, career: undefined, education: undefined, fashion: undefined, finance: undefined, food: undefined, government: undefined, hobbies: undefined, home: undefined, news: undefined, realEstate: undefined, society: undefined, sports: undefined, tech: undefined, travel: undefined }) {
|
||||
try {
|
||||
FfiConverterU32.checkType(inconclusive)
|
||||
} catch (e) {
|
||||
|
||||
@@ -972,7 +972,7 @@ export class FfiConverterTypeRemoteSettingsService extends FfiConverter {
|
||||
* included in calls to [Client::get_attachment].
|
||||
*/
|
||||
export class Attachment {
|
||||
constructor({ filename, mimetype, location, hash, size }) {
|
||||
constructor({ filename, mimetype, location, hash, size } = { filename: undefined, mimetype: undefined, location: undefined, hash: undefined, size: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(filename)
|
||||
} catch (e) {
|
||||
@@ -1132,7 +1132,7 @@ export class FfiConverterTypeAttachment extends FfiConverterArrayBuffer {
|
||||
* - `collection_name`: The name of the collection for the settings server.
|
||||
*/
|
||||
export class RemoteSettingsConfig {
|
||||
constructor({ collectionName, bucketName = null, serverUrl = null, server = null }) {
|
||||
constructor({ collectionName, bucketName = null, serverUrl = null, server = null } = { collectionName: undefined, bucketName: undefined, serverUrl: undefined, server: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(collectionName)
|
||||
} catch (e) {
|
||||
@@ -1267,7 +1267,7 @@ export class FfiConverterTypeRemoteSettingsConfig extends FfiConverterArrayBuffe
|
||||
* name.
|
||||
*/
|
||||
export class RemoteSettingsConfig2 {
|
||||
constructor({ server = null, bucketName = null, appContext = null }) {
|
||||
constructor({ server = null, bucketName = null, appContext = null } = { server: undefined, bucketName: undefined, appContext: undefined }) {
|
||||
try {
|
||||
FfiConverterOptionalTypeRemoteSettingsServer.checkType(server)
|
||||
} catch (e) {
|
||||
@@ -1383,7 +1383,7 @@ export class FfiConverterTypeRemoteSettingsConfig2 extends FfiConverterArrayBuff
|
||||
* When set, only records where the expression is true will be returned.
|
||||
*/
|
||||
export class RemoteSettingsContext {
|
||||
constructor({ appName, appId, channel, appVersion, appBuild, architecture, deviceManufacturer, deviceModel, locale, os, osVersion, androidSdkVersion, debugTag, installationDate, homeDirectory, customTargetingAttributes }) {
|
||||
constructor({ appName, appId, channel, appVersion, appBuild, architecture, deviceManufacturer, deviceModel, locale, os, osVersion, androidSdkVersion, debugTag, installationDate, homeDirectory, customTargetingAttributes } = { appName: undefined, appId: undefined, channel: undefined, appVersion: undefined, appBuild: undefined, architecture: undefined, deviceManufacturer: undefined, deviceModel: undefined, locale: undefined, os: undefined, osVersion: undefined, androidSdkVersion: undefined, debugTag: undefined, installationDate: undefined, homeDirectory: undefined, customTargetingAttributes: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(appName)
|
||||
} catch (e) {
|
||||
@@ -1819,7 +1819,7 @@ export class FfiConverterTypeRemoteSettingsContext extends FfiConverterArrayBuff
|
||||
* are required to further extract expected values from the [fields] member.
|
||||
*/
|
||||
export class RemoteSettingsRecord {
|
||||
constructor({ id, lastModified, deleted, attachment, fields }) {
|
||||
constructor({ id, lastModified, deleted, attachment, fields } = { id: undefined, lastModified: undefined, deleted: undefined, attachment: undefined, fields: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(id)
|
||||
} catch (e) {
|
||||
@@ -1976,7 +1976,7 @@ export class FfiConverterTypeRemoteSettingsRecord extends FfiConverterArrayBuffe
|
||||
* [last_modified] will be extracted from the etag header of the response.
|
||||
*/
|
||||
export class RemoteSettingsResponse {
|
||||
constructor({ records, lastModified }) {
|
||||
constructor({ records, lastModified } = { records: undefined, lastModified: undefined }) {
|
||||
try {
|
||||
FfiConverterSequenceTypeRemoteSettingsRecord.checkType(records)
|
||||
} catch (e) {
|
||||
|
||||
@@ -556,7 +556,7 @@ export class FfiConverterTypeSearchEngineSelector extends FfiConverter {
|
||||
* configuration.
|
||||
*/
|
||||
export class JsonEngineUrl {
|
||||
constructor({ base, method, params, searchTermParamName }) {
|
||||
constructor({ base, method, params, searchTermParamName } = { base: undefined, method: undefined, params: undefined, searchTermParamName: undefined }) {
|
||||
try {
|
||||
FfiConverterOptionalstring.checkType(base)
|
||||
} catch (e) {
|
||||
@@ -696,7 +696,7 @@ export class FfiConverterTypeJsonEngineUrl extends FfiConverterArrayBuffer {
|
||||
* Reflects `types::SearchEngineUrls`, but using `EngineUrl`.
|
||||
*/
|
||||
export class JsonEngineUrls {
|
||||
constructor({ search, suggestions, trending, searchForm }) {
|
||||
constructor({ search, suggestions, trending, searchForm } = { search: undefined, suggestions: undefined, trending: undefined, searchForm: undefined }) {
|
||||
try {
|
||||
FfiConverterOptionalTypeJsonEngineUrl.checkType(search)
|
||||
} catch (e) {
|
||||
@@ -832,7 +832,7 @@ export class FfiConverterTypeJsonEngineUrls extends FfiConverterArrayBuffer {
|
||||
* of processing the search configuration.
|
||||
*/
|
||||
export class RefinedSearchConfig {
|
||||
constructor({ engines, appDefaultEngineId, appPrivateDefaultEngineId }) {
|
||||
constructor({ engines, appDefaultEngineId, appPrivateDefaultEngineId } = { engines: undefined, appDefaultEngineId: undefined, appPrivateDefaultEngineId: undefined }) {
|
||||
try {
|
||||
FfiConverterSequenceTypeSearchEngineDefinition.checkType(engines)
|
||||
} catch (e) {
|
||||
@@ -959,7 +959,7 @@ export class FfiConverterTypeRefinedSearchConfig extends FfiConverterArrayBuffer
|
||||
* A definition for an individual search engine to be presented to the user.
|
||||
*/
|
||||
export class SearchEngineDefinition {
|
||||
constructor({ aliases, charset, classification, identifier, name, optional, partnerCode, telemetrySuffix, urls, orderHint }) {
|
||||
constructor({ aliases, charset, classification, identifier, name, optional, partnerCode, telemetrySuffix, urls, orderHint } = { aliases: undefined, charset: undefined, classification: undefined, identifier: undefined, name: undefined, optional: undefined, partnerCode: undefined, telemetrySuffix: undefined, urls: undefined, orderHint: undefined }) {
|
||||
try {
|
||||
FfiConverterSequencestring.checkType(aliases)
|
||||
} catch (e) {
|
||||
@@ -1259,7 +1259,7 @@ export class FfiConverterTypeSearchEngineDefinition extends FfiConverterArrayBuf
|
||||
* Defines an individual search engine URL.
|
||||
*/
|
||||
export class SearchEngineUrl {
|
||||
constructor({ base, method, params, searchTermParamName }) {
|
||||
constructor({ base, method, params, searchTermParamName } = { base: undefined, method: undefined, params: undefined, searchTermParamName: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(base)
|
||||
} catch (e) {
|
||||
@@ -1399,7 +1399,7 @@ export class FfiConverterTypeSearchEngineUrl extends FfiConverterArrayBuffer {
|
||||
* The URLs associated with the search engine.
|
||||
*/
|
||||
export class SearchEngineUrls {
|
||||
constructor({ search, suggestions, trending, searchForm }) {
|
||||
constructor({ search, suggestions, trending, searchForm } = { search: undefined, suggestions: undefined, trending: undefined, searchForm: undefined }) {
|
||||
try {
|
||||
FfiConverterTypeSearchEngineUrl.checkType(search)
|
||||
} catch (e) {
|
||||
@@ -1535,7 +1535,7 @@ export class FfiConverterTypeSearchEngineUrls extends FfiConverterArrayBuffer {
|
||||
* specified, along with one of value, experiment_config or search_access_point.
|
||||
*/
|
||||
export class SearchUrlParam {
|
||||
constructor({ name, value, enterpriseValue, experimentConfig }) {
|
||||
constructor({ name, value, enterpriseValue, experimentConfig } = { name: undefined, value: undefined, enterpriseValue: undefined, experimentConfig: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(name)
|
||||
} catch (e) {
|
||||
@@ -1674,7 +1674,7 @@ export class FfiConverterTypeSearchUrlParam extends FfiConverterArrayBuffer {
|
||||
* The user's environment that is used for filtering the search configuration.
|
||||
*/
|
||||
export class SearchUserEnvironment {
|
||||
constructor({ locale, region, updateChannel, distributionId, experiment, appName, version, deviceType }) {
|
||||
constructor({ locale, region, updateChannel, distributionId, experiment, appName, version, deviceType } = { locale: undefined, region: undefined, updateChannel: undefined, distributionId: undefined, experiment: undefined, appName: undefined, version: undefined, deviceType: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(locale)
|
||||
} catch (e) {
|
||||
|
||||
@@ -1156,7 +1156,7 @@ export class FfiConverterTypeSuggestStoreBuilder extends FfiConverter {
|
||||
* Additional data about how an FTS match was made
|
||||
*/
|
||||
export class FtsMatchInfo {
|
||||
constructor({ prefix, stemming }) {
|
||||
constructor({ prefix, stemming } = { prefix: undefined, stemming: undefined }) {
|
||||
try {
|
||||
FfiConverterBool.checkType(prefix)
|
||||
} catch (e) {
|
||||
@@ -1246,7 +1246,7 @@ export class FfiConverterTypeFtsMatchInfo extends FfiConverterArrayBuffer {
|
||||
* [1]: https://download.geonames.org/export/dump/readme.txt
|
||||
*/
|
||||
export class Geoname {
|
||||
constructor({ geonameId, name, latitude, longitude, countryCode, admin1Code, population }) {
|
||||
constructor({ geonameId, name, latitude, longitude, countryCode, admin1Code, population } = { geonameId: undefined, name: undefined, latitude: undefined, longitude: undefined, countryCode: undefined, admin1Code: undefined, population: undefined }) {
|
||||
try {
|
||||
FfiConverterI64.checkType(geonameId)
|
||||
} catch (e) {
|
||||
@@ -1462,7 +1462,7 @@ export class FfiConverterTypeGeoname extends FfiConverterArrayBuffer {
|
||||
* A fetched geoname with info on how it was matched.
|
||||
*/
|
||||
export class GeonameMatch {
|
||||
constructor({ geoname, matchType, prefix }) {
|
||||
constructor({ geoname, matchType, prefix } = { geoname: undefined, matchType: undefined, prefix: undefined }) {
|
||||
try {
|
||||
FfiConverterTypeGeoname.checkType(geoname)
|
||||
} catch (e) {
|
||||
@@ -1572,7 +1572,7 @@ export class FfiConverterTypeGeonameMatch extends FfiConverterArrayBuffer {
|
||||
* Single sample for a Glean labeled_timing_distribution
|
||||
*/
|
||||
export class LabeledTimingSample {
|
||||
constructor({ label, value }) {
|
||||
constructor({ label, value } = { label: undefined, value: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(label)
|
||||
} catch (e) {
|
||||
@@ -1656,7 +1656,7 @@ export class FfiConverterTypeLabeledTimingSample extends FfiConverterArrayBuffer
|
||||
* QueryWithMetricsResult
|
||||
*/
|
||||
export class QueryWithMetricsResult {
|
||||
constructor({ suggestions, queryTimes }) {
|
||||
constructor({ suggestions, queryTimes } = { suggestions: undefined, queryTimes: undefined }) {
|
||||
try {
|
||||
FfiConverterSequenceTypeSuggestion.checkType(suggestions)
|
||||
} catch (e) {
|
||||
@@ -1740,7 +1740,7 @@ export class FfiConverterTypeQueryWithMetricsResult extends FfiConverterArrayBuf
|
||||
* Global Suggest configuration data.
|
||||
*/
|
||||
export class SuggestGlobalConfig {
|
||||
constructor({ showLessFrequentlyCap }) {
|
||||
constructor({ showLessFrequentlyCap } = { showLessFrequentlyCap: undefined }) {
|
||||
try {
|
||||
FfiConverterI32.checkType(showLessFrequentlyCap)
|
||||
} catch (e) {
|
||||
@@ -1799,7 +1799,7 @@ export class FfiConverterTypeSuggestGlobalConfig extends FfiConverterArrayBuffer
|
||||
* Constraints limit which suggestions to ingest from Remote Settings.
|
||||
*/
|
||||
export class SuggestIngestionConstraints {
|
||||
constructor({ providers = null, providerConstraints = null, emptyOnly = false }) {
|
||||
constructor({ providers = null, providerConstraints = null, emptyOnly = false } = { providers: undefined, providerConstraints: undefined, emptyOnly: undefined }) {
|
||||
try {
|
||||
FfiConverterOptionalSequenceTypeSuggestionProvider.checkType(providers)
|
||||
} catch (e) {
|
||||
@@ -1910,7 +1910,7 @@ export class FfiConverterTypeSuggestIngestionConstraints extends FfiConverterArr
|
||||
* These are recorded during [crate::Store::ingest] and returned to the consumer to record.
|
||||
*/
|
||||
export class SuggestIngestionMetrics {
|
||||
constructor({ ingestionTimes, downloadTimes }) {
|
||||
constructor({ ingestionTimes, downloadTimes } = { ingestionTimes: undefined, downloadTimes: undefined }) {
|
||||
try {
|
||||
FfiConverterSequenceTypeLabeledTimingSample.checkType(ingestionTimes)
|
||||
} catch (e) {
|
||||
@@ -1996,7 +1996,7 @@ export class FfiConverterTypeSuggestIngestionMetrics extends FfiConverterArrayBu
|
||||
* other operations on those providers must be constrained to a desired subtype.
|
||||
*/
|
||||
export class SuggestionProviderConstraints {
|
||||
constructor({ exposureSuggestionTypes = null, ampAlternativeMatching = null }) {
|
||||
constructor({ exposureSuggestionTypes = null, ampAlternativeMatching = null } = { exposureSuggestionTypes: undefined, ampAlternativeMatching: undefined }) {
|
||||
try {
|
||||
FfiConverterOptionalSequencestring.checkType(exposureSuggestionTypes)
|
||||
} catch (e) {
|
||||
@@ -2084,7 +2084,7 @@ export class FfiConverterTypeSuggestionProviderConstraints extends FfiConverterA
|
||||
* A query for suggestions to show in the address bar.
|
||||
*/
|
||||
export class SuggestionQuery {
|
||||
constructor({ keyword, providers, providerConstraints = null, limit = null }) {
|
||||
constructor({ keyword, providers, providerConstraints = null, limit = null } = { keyword: undefined, providers: undefined, providerConstraints: undefined, limit: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(keyword)
|
||||
} catch (e) {
|
||||
|
||||
@@ -1187,7 +1187,7 @@ export class FfiConverterTypeTabsStore extends FfiConverter {
|
||||
* ClientRemoteTabs
|
||||
*/
|
||||
export class ClientRemoteTabs {
|
||||
constructor({ clientId, clientName, deviceType, lastModified, remoteTabs }) {
|
||||
constructor({ clientId, clientName, deviceType, lastModified, remoteTabs } = { clientId: undefined, clientName: undefined, deviceType: undefined, lastModified: undefined, remoteTabs: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(clientId)
|
||||
} catch (e) {
|
||||
@@ -1343,7 +1343,7 @@ export class FfiConverterTypeClientRemoteTabs extends FfiConverterArrayBuffer {
|
||||
* Represents a "pending" command.
|
||||
*/
|
||||
export class PendingCommand {
|
||||
constructor({ deviceId, command, timeRequested, timeSent }) {
|
||||
constructor({ deviceId, command, timeRequested, timeSent } = { deviceId: undefined, command: undefined, timeRequested: undefined, timeSent: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(deviceId)
|
||||
} catch (e) {
|
||||
@@ -1474,7 +1474,7 @@ export class FfiConverterTypePendingCommand extends FfiConverterArrayBuffer {
|
||||
* RemoteTabRecord
|
||||
*/
|
||||
export class RemoteTabRecord {
|
||||
constructor({ title, urlHistory, icon, lastUsed, inactive = false }) {
|
||||
constructor({ title, urlHistory, icon, lastUsed, inactive = false } = { title: undefined, urlHistory: undefined, icon: undefined, lastUsed: undefined, inactive: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(title)
|
||||
} catch (e) {
|
||||
|
||||
@@ -1063,7 +1063,7 @@ export class FfiConverterTypeWebExtStorageStore extends FfiConverter {
|
||||
* StorageChanges
|
||||
*/
|
||||
export class StorageChanges {
|
||||
constructor({ changes }) {
|
||||
constructor({ changes } = { changes: undefined }) {
|
||||
try {
|
||||
FfiConverterSequenceTypeStorageValueChange.checkType(changes)
|
||||
} catch (e) {
|
||||
@@ -1122,7 +1122,7 @@ export class FfiConverterTypeStorageChanges extends FfiConverterArrayBuffer {
|
||||
* StorageValueChange
|
||||
*/
|
||||
export class StorageValueChange {
|
||||
constructor({ key, oldValue, newValue }) {
|
||||
constructor({ key, oldValue, newValue } = { key: undefined, oldValue: undefined, newValue: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(key)
|
||||
} catch (e) {
|
||||
@@ -1229,7 +1229,7 @@ export class FfiConverterTypeStorageValueChange extends FfiConverterArrayBuffer
|
||||
* SyncedExtensionChange
|
||||
*/
|
||||
export class SyncedExtensionChange {
|
||||
constructor({ extId, changes }) {
|
||||
constructor({ extId, changes } = { extId: undefined, changes: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(extId)
|
||||
} catch (e) {
|
||||
|
||||
@@ -327,7 +327,7 @@ export class FfiConverterString extends FfiConverter {
|
||||
* CustomTypesDemo
|
||||
*/
|
||||
export class CustomTypesDemo {
|
||||
constructor({ url, handle }) {
|
||||
constructor({ url, handle } = { url: undefined, handle: undefined }) {
|
||||
try {
|
||||
FfiConverterTypeUrl.checkType(url)
|
||||
} catch (e) {
|
||||
|
||||
@@ -321,7 +321,7 @@ export class FfiConverterString extends FfiConverter {
|
||||
* Line
|
||||
*/
|
||||
export class Line {
|
||||
constructor({ start, end }) {
|
||||
constructor({ start, end } = { start: undefined, end: undefined }) {
|
||||
try {
|
||||
FfiConverterTypePoint.checkType(start)
|
||||
} catch (e) {
|
||||
@@ -404,7 +404,7 @@ export class FfiConverterTypeLine extends FfiConverterArrayBuffer {
|
||||
* Point
|
||||
*/
|
||||
export class Point {
|
||||
constructor({ coordX, coordY }) {
|
||||
constructor({ coordX, coordY } = { coordX: undefined, coordY: undefined }) {
|
||||
try {
|
||||
FfiConverterF64.checkType(coordX)
|
||||
} catch (e) {
|
||||
|
||||
@@ -2347,7 +2347,7 @@ export class FfiConverterTypeStringifier extends FfiConverter {
|
||||
* Dictionnaire
|
||||
*/
|
||||
export class Dictionnaire {
|
||||
constructor({ un, deux, petitNombre, grosNombre }) {
|
||||
constructor({ un, deux, petitNombre, grosNombre } = { un: undefined, deux: undefined, petitNombre: undefined, grosNombre: undefined }) {
|
||||
try {
|
||||
FfiConverterTypeEnumeration.checkType(un)
|
||||
} catch (e) {
|
||||
@@ -2478,7 +2478,7 @@ export class FfiConverterTypeDictionnaire extends FfiConverterArrayBuffer {
|
||||
* DictionnaireNombres
|
||||
*/
|
||||
export class DictionnaireNombres {
|
||||
constructor({ petitNombre, courtNombre, nombreSimple, grosNombre }) {
|
||||
constructor({ petitNombre, courtNombre, nombreSimple, grosNombre } = { petitNombre: undefined, courtNombre: undefined, nombreSimple: undefined, grosNombre: undefined }) {
|
||||
try {
|
||||
FfiConverterU8.checkType(petitNombre)
|
||||
} catch (e) {
|
||||
@@ -2609,7 +2609,7 @@ export class FfiConverterTypeDictionnaireNombres extends FfiConverterArrayBuffer
|
||||
* DictionnaireNombresSignes
|
||||
*/
|
||||
export class DictionnaireNombresSignes {
|
||||
constructor({ petitNombre, courtNombre, nombreSimple, grosNombre }) {
|
||||
constructor({ petitNombre, courtNombre, nombreSimple, grosNombre } = { petitNombre: undefined, courtNombre: undefined, nombreSimple: undefined, grosNombre: undefined }) {
|
||||
try {
|
||||
FfiConverterI8.checkType(petitNombre)
|
||||
} catch (e) {
|
||||
@@ -2740,7 +2740,7 @@ export class FfiConverterTypeDictionnaireNombresSignes extends FfiConverterArray
|
||||
* OptionneurDictionnaire
|
||||
*/
|
||||
export class OptionneurDictionnaire {
|
||||
constructor({ i8Var = -8, u8Var = 8, i16Var = -16, u16Var = 0x10, i32Var = -32, u32Var = 32, i64Var = -64, u64Var = 64, floatVar = 4.0, doubleVar = 8.0, booleanVar = true, stringVar = "default", listVar = [], enumerationVar = Enumeration.DEUX, dictionnaireVar = null }) {
|
||||
constructor({ i8Var = -8, u8Var = 8, i16Var = -16, u16Var = 0x10, i32Var = -32, u32Var = 32, i64Var = -64, u64Var = 64, floatVar = 4.0, doubleVar = 8.0, booleanVar = true, stringVar = "default", listVar = [], enumerationVar = Enumeration.DEUX, dictionnaireVar = null } = { i8Var: undefined, u8Var: undefined, i16Var: undefined, u16Var: undefined, i32Var: undefined, u32Var: undefined, i64Var: undefined, u64Var: undefined, floatVar: undefined, doubleVar: undefined, booleanVar: undefined, stringVar: undefined, listVar: undefined, enumerationVar: undefined, dictionnaireVar: undefined }) {
|
||||
try {
|
||||
FfiConverterI8.checkType(i8Var)
|
||||
} catch (e) {
|
||||
@@ -3135,7 +3135,7 @@ export class FfiConverterTypeOptionneurDictionnaire extends FfiConverterArrayBuf
|
||||
* MinusculeMajusculeDict
|
||||
*/
|
||||
export class MinusculeMajusculeDict {
|
||||
constructor({ minusculeMajusculeField }) {
|
||||
constructor({ minusculeMajusculeField } = { minusculeMajusculeField: undefined }) {
|
||||
try {
|
||||
FfiConverterBool.checkType(minusculeMajusculeField)
|
||||
} catch (e) {
|
||||
|
||||
@@ -526,7 +526,7 @@ export class FfiConverterTypeSprite extends FfiConverter {
|
||||
* Point
|
||||
*/
|
||||
export class Point {
|
||||
constructor({ x, y }) {
|
||||
constructor({ x, y } = { x: undefined, y: undefined }) {
|
||||
try {
|
||||
FfiConverterF64.checkType(x)
|
||||
} catch (e) {
|
||||
@@ -609,7 +609,7 @@ export class FfiConverterTypePoint extends FfiConverterArrayBuffer {
|
||||
* Vector
|
||||
*/
|
||||
export class Vector {
|
||||
constructor({ dx, dy }) {
|
||||
constructor({ dx, dy } = { dx: undefined, dy: undefined }) {
|
||||
try {
|
||||
FfiConverterF64.checkType(dx)
|
||||
} catch (e) {
|
||||
|
||||
@@ -646,7 +646,7 @@ export class FfiConverterTypeTodoList extends FfiConverter {
|
||||
* TodoEntry
|
||||
*/
|
||||
export class TodoEntry {
|
||||
constructor({ text }) {
|
||||
constructor({ text } = { text: undefined }) {
|
||||
try {
|
||||
FfiConverterString.checkType(text)
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{%- let record = ci.get_record_definition(name).unwrap() -%}
|
||||
{{ record.js_docstring(0) -}}
|
||||
export class {{ record.js_name() }} {
|
||||
constructor({{ record.constructor_field_list() }}) {
|
||||
constructor({{ record.constructor_field_list() }} = { {% for f in record.fields() %}{{ f.js_name() }}: undefined{% if !loop.last %}, {% endif %}{% endfor %} }) {
|
||||
{%- for field in record.fields() %}
|
||||
try {
|
||||
{{ field.ffi_converter() }}.checkType({{ field.js_name() }})
|
||||
|
||||
Reference in New Issue
Block a user