Skip to content

Last two type issues (scroll view component + core/string fromCodePoint) #7616

@kungfooman

Description

@kungfooman

/**
* @param {string} onOrOff - 'on' or 'off'.
* @param {ScrollViewComponentSystem} system - The ComponentSystem that
* created this Component.
* @private
*/
_toggleLifecycleListeners(onOrOff) {
this[onOrOff]('set_horizontal', this._onSetHorizontalScrollingEnabled, this);
this[onOrOff]('set_vertical', this._onSetVerticalScrollingEnabled, this);
this.entity[onOrOff]('element:add', this._onElementComponentAdd, this);
}

(system isn't an argument)

engine/src/core/string.js

Lines 218 to 238 in d076f26

/**
* Get the string for a given code point or set of code points. Polyfill for
* [`fromCodePoint`]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint}.
*
* @param {...number} args - The code points to convert to a string.
* @returns {string} The converted string.
*/
fromCodePoint(/* ...args */) {
const chars = [];
let current;
let codePoint;
let units;
for (let i = 0; i < arguments.length; ++i) {
current = Number(arguments[i]);
codePoint = current - 0x10000;
units = current > 0xFFFF ? [(codePoint >> 10) + 0xD800, (codePoint % 0x400) + 0xDC00] : [current];
chars.push(String.fromCharCode.apply(null, units));
}
return chars.join('');
}
};

(still just accessing arguments)

I've seen a lot of types being fixed recently, so it would be nice if they could all be fixed (getting rid of warning messages) 💯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions