Skip to content

string.format() doesn't work under IE 11 #148

@Egor-Skriptunoff

Description

@Egor-Skriptunoff

Fengari is said to be "Verified to work in Microsoft IE 11".
But unfortunately an error is raised under IE 11:

print(("%02X"):format(0))
TypeError: Object doesn't support property or method 'repeat'

fengari_ie11

It seems that the sprintf.js which implements string.format is not IE11-compatible.
The problem is in the single line of code:

pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''

Unfortunately, repeat is not implemented on all IE, including IE11

BTW .repeat occurs also in lstrlib.js.

Support of IE11 actually means support of Windows 7 users.
There are a lot of them nowadays.

All what is needed for happiness is to implement String.prototype.repeat manually in Fengari.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions