Skip to content

Number formatting fails in strict mode #854

@ashubham

Description

@ashubham

When bundling for ES6 modules, the scripts are by default loaded in 'strict mode'. The number formatting in globalize seems to be violating strict mode in these lines:

https://github.com/globalizejs/globalize/blob/master/src/number/format-properties.js#L74

properties[ 2 ] = negativeSuffix[ 2 ] = 1; // minimumIntegerDigits
properties[ 3 ] = negativeSuffix[ 3 ] = 0; // minimumFractionDigits
properties[ 4 ] = negativeSuffix[ 4 ] = 0; // maximumFractionDigits

It fails with TypeError: Cannot create property '2' on string ''

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