Skip to content

Commit 8695d28

Browse files
authored
[embind] Fix indentation. NFC (#24473)
1 parent 835eae3 commit 8695d28

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

src/lib/libembind.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -247,74 +247,74 @@ var LibraryEmbind = {
247247
_embind_register_bool: (rawType, name, trueValue, falseValue) => {
248248
name = AsciiToString(name);
249249
registerType(rawType, {
250-
name,
251-
'fromWireType': function(wt) {
252-
// ambiguous emscripten ABI: sometimes return values are
253-
// true or false, and sometimes integers (0 or 1)
254-
return !!wt;
255-
},
256-
'toWireType': function(destructors, o) {
257-
return o ? trueValue : falseValue;
258-
},
259-
argPackAdvance: GenericWireTypeSize,
260-
'readValueFromPointer': function(pointer) {
261-
return this['fromWireType'](HEAPU8[pointer]);
262-
},
263-
destructorFunction: null, // This type does not need a destructor
250+
name,
251+
'fromWireType': function(wt) {
252+
// ambiguous emscripten ABI: sometimes return values are
253+
// true or false, and sometimes integers (0 or 1)
254+
return !!wt;
255+
},
256+
'toWireType': function(destructors, o) {
257+
return o ? trueValue : falseValue;
258+
},
259+
argPackAdvance: GenericWireTypeSize,
260+
'readValueFromPointer': function(pointer) {
261+
return this['fromWireType'](HEAPU8[pointer]);
262+
},
263+
destructorFunction: null, // This type does not need a destructor
264264
});
265265
},
266266

267267
$integerReadValueFromPointer__deps: [],
268268
$integerReadValueFromPointer: (name, width, signed) => {
269269
// integers are quite common, so generate very specialized functions
270270
switch (width) {
271-
case 1: return signed ?
272-
(pointer) => {{{ makeGetValue('pointer', 0, 'i8') }}} :
273-
(pointer) => {{{ makeGetValue('pointer', 0, 'u8') }}};
274-
case 2: return signed ?
275-
(pointer) => {{{ makeGetValue('pointer', 0, 'i16') }}} :
276-
(pointer) => {{{ makeGetValue('pointer', 0, 'u16') }}}
277-
case 4: return signed ?
278-
(pointer) => {{{ makeGetValue('pointer', 0, 'i32') }}} :
279-
(pointer) => {{{ makeGetValue('pointer', 0, 'u32') }}}
271+
case 1: return signed ?
272+
(pointer) => {{{ makeGetValue('pointer', 0, 'i8') }}} :
273+
(pointer) => {{{ makeGetValue('pointer', 0, 'u8') }}};
274+
case 2: return signed ?
275+
(pointer) => {{{ makeGetValue('pointer', 0, 'i16') }}} :
276+
(pointer) => {{{ makeGetValue('pointer', 0, 'u16') }}}
277+
case 4: return signed ?
278+
(pointer) => {{{ makeGetValue('pointer', 0, 'i32') }}} :
279+
(pointer) => {{{ makeGetValue('pointer', 0, 'u32') }}}
280280
#if WASM_BIGINT
281-
case 8: return signed ?
282-
(pointer) => {{{ makeGetValue('pointer', 0, 'i64') }}} :
283-
(pointer) => {{{ makeGetValue('pointer', 0, 'u64') }}}
281+
case 8: return signed ?
282+
(pointer) => {{{ makeGetValue('pointer', 0, 'i64') }}} :
283+
(pointer) => {{{ makeGetValue('pointer', 0, 'u64') }}}
284284
#endif
285-
default:
286-
throw new TypeError(`invalid integer width (${width}): ${name}`);
285+
default:
286+
throw new TypeError(`invalid integer width (${width}): ${name}`);
287287
}
288288
},
289289

290290
$enumReadValueFromPointer__deps: [],
291291
$enumReadValueFromPointer: (name, width, signed) => {
292292
switch (width) {
293-
case 1: return signed ?
294-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i8') }}}) } :
295-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u8') }}}) };
296-
case 2: return signed ?
297-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i16') }}}) } :
298-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u16') }}}) };
299-
case 4: return signed ?
300-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i32') }}}) } :
301-
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u32') }}}) };
302-
default:
303-
throw new TypeError(`invalid integer width (${width}): ${name}`);
293+
case 1: return signed ?
294+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i8') }}}) } :
295+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u8') }}}) };
296+
case 2: return signed ?
297+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i16') }}}) } :
298+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u16') }}}) };
299+
case 4: return signed ?
300+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'i32') }}}) } :
301+
function(pointer) { return this['fromWireType']({{{ makeGetValue('pointer', 0, 'u32') }}}) };
302+
default:
303+
throw new TypeError(`invalid integer width (${width}): ${name}`);
304304
}
305305
},
306306

307307
$floatReadValueFromPointer__deps: [],
308308
$floatReadValueFromPointer: (name, width) => {
309309
switch (width) {
310-
case 4: return function(pointer) {
311-
return this['fromWireType']({{{ makeGetValue('pointer', 0, 'float') }}});
312-
};
313-
case 8: return function(pointer) {
314-
return this['fromWireType']({{{ makeGetValue('pointer', 0, 'double') }}});
315-
};
316-
default:
317-
throw new TypeError(`invalid float width (${width}): ${name}`);
310+
case 4: return function(pointer) {
311+
return this['fromWireType']({{{ makeGetValue('pointer', 0, 'float') }}});
312+
};
313+
case 8: return function(pointer) {
314+
return this['fromWireType']({{{ makeGetValue('pointer', 0, 'double') }}});
315+
};
316+
default:
317+
throw new TypeError(`invalid float width (${width}): ${name}`);
318318
}
319319
},
320320

@@ -1239,7 +1239,7 @@ var LibraryEmbind = {
12391239
throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);
12401240
}
12411241
if (handle.$$.ptrType.isConst) {
1242-
throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`);
1242+
throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`);
12431243
}
12441244
var handleClass = handle.$$.ptrType.registeredClass;
12451245
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);

0 commit comments

Comments
 (0)