Skip to content

Commit

Permalink
Suppress embind closure compiler warnings (#20166)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiulongw authored Sep 12, 2023
1 parent 453e83a commit 594d27d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/embind/embind.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ var LibraryEmbind = {
});
},

_embind_register_bool__docs: '/** @suppress {globalThis} */',
_embind_register_bool__deps: ['$readLatin1String', '$registerType', '$GenericWireTypeSize'],
_embind_register_bool: (rawType, name, trueValue, falseValue) => {
name = readLatin1String(name);
Expand Down Expand Up @@ -350,6 +351,7 @@ var LibraryEmbind = {
}
},

_embind_register_integer__docs: '/** @suppress {globalThis} */',
// When converting a number from JS to C++ side, the valid range of the number is
// [minRange, maxRange], inclusive.
_embind_register_integer__deps: [
Expand Down Expand Up @@ -464,11 +466,13 @@ var LibraryEmbind = {
});
},

$simpleReadValueFromPointer__docs: '/** @suppress {globalThis} */',
// For types whose wire types are 32-bit pointers.
$simpleReadValueFromPointer: function(pointer) {
return this['fromWireType']({{{ makeGetValue('pointer', '0', 'i32') }}});
},

$readPointer__docs: '/** @suppress {globalThis} */',
$readPointer: function(pointer) {
return this['fromWireType']({{{ makeGetValue('pointer', '0', '*') }}});
},
Expand Down Expand Up @@ -1217,6 +1221,7 @@ var LibraryEmbind = {
});
},

$genericPointerToWireType__docs: '/** @suppress {globalThis} */',
$genericPointerToWireType__deps: ['$throwBindingError', '$upcastPointer'],
$genericPointerToWireType: function(destructors, handle) {
var ptr;
Expand Down Expand Up @@ -1292,6 +1297,7 @@ var LibraryEmbind = {
return ptr;
},

$constNoSmartPtrRawPointerToWireType__docs: '/** @suppress {globalThis} */',
// If we know a pointer type is not going to have SmartPtr logic in it, we can
// special-case optimize it a bit (compare to genericPointerToWireType)
$constNoSmartPtrRawPointerToWireType__deps: ['$throwBindingError', '$upcastPointer'],
Expand All @@ -1314,6 +1320,7 @@ var LibraryEmbind = {
return ptr;
},

$nonConstNoSmartPtrRawPointerToWireType__docs: '/** @suppress {globalThis} */',
// An optimized version for non-const method accesses - there we must additionally restrict that
// the pointer is not a const-pointer.
$nonConstNoSmartPtrRawPointerToWireType__deps: ['$throwBindingError', '$upcastPointer'],
Expand Down Expand Up @@ -1410,13 +1417,15 @@ var LibraryEmbind = {
}
},

$RegisteredPointer_getPointee__docs: '/** @suppress {globalThis} */',
$RegisteredPointer_getPointee: function(ptr) {
if (this.rawGetPointee) {
ptr = this.rawGetPointee(ptr);
}
return ptr;
},

$RegisteredPointer_destructor__docs: '/** @suppress {globalThis} */',
$RegisteredPointer_destructor: function(ptr) {
if (this.rawDestructor) {
this.rawDestructor(ptr);
Expand All @@ -1429,6 +1438,7 @@ var LibraryEmbind = {
}
},

$RegisteredPointer_fromWireType__docs: '/** @suppress {globalThis} */',
$RegisteredPointer_fromWireType__deps: [
'$downcastPointer', '$registeredPointers',
'$getInheritedInstance', '$makeClassHandle',
Expand Down Expand Up @@ -1621,6 +1631,7 @@ var LibraryEmbind = {
$ClassHandle: function() {
},

$ClassHandle_isAliasOf__docs: '/** @suppress {globalThis,checkTypes} */',
$ClassHandle_isAliasOf: function(other) {
if (!(this instanceof ClassHandle)) {
return false;
Expand Down Expand Up @@ -1656,6 +1667,7 @@ var LibraryEmbind = {
throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
},

$ClassHandle_clone__docs: '/** @suppress {globalThis} */',
$ClassHandle_clone__deps: ['$shallowCopyInternalPointer', '$throwInstanceAlreadyDeleted', '$attachFinalizer'],
$ClassHandle_clone: function() {
if (!this.$$.ptr) {
Expand All @@ -1678,6 +1690,7 @@ var LibraryEmbind = {
}
},

$ClassHandle_delete__docs: '/** @suppress {globalThis} */',
$ClassHandle_delete__deps: ['$releaseClassHandle', '$throwBindingError',
'$detachFinalizer', '$throwInstanceAlreadyDeleted'],
$ClassHandle_delete: function() {
Expand All @@ -1700,10 +1713,12 @@ var LibraryEmbind = {

$deletionQueue: [],

$ClassHandle_isDeleted__docs: '/** @suppress {globalThis} */',
$ClassHandle_isDeleted: function() {
return !this.$$.ptr;
},

$ClassHandle_deleteLater__docs: '/** @suppress {globalThis} */',
$ClassHandle_deleteLater__deps: [
'$delayFunction', '$deletionQueue', '$flushPendingDeletes'],
$ClassHandle_deleteLater: function() {
Expand Down Expand Up @@ -2365,6 +2380,7 @@ var LibraryEmbind = {
});
},

_embind_register_enum__docs: '/** @suppress {globalThis} */',
_embind_register_enum__deps: ['$exposePublicSymbol', '$enumReadValueFromPointer',
'$readLatin1String', '$registerType'],
_embind_register_enum: (rawType, name, size, isSigned) => {
Expand Down

0 comments on commit 594d27d

Please sign in to comment.