Skip to content

Problem with Object.defineProperties on Android browsers #29

Description

@garryyao

The native implementation of Object.defineProperties on Android version >= 2.3.6 && <= 4.0.3 seems to be buggy, where the following test case fails as below, can we check if we need to shim up a bit on those devices?

==========Code==========

function fn() {};

try {
    Object.defineProperties(fn, {
        prototype: {
            value: {
                test: true
            }
        }
    });
}
catch (ex) {
    alert(ex);
}

alert(fn.prototype.test);

==========Code==========

==========Result=========
Platform APILevel Result
1.5 3 TypeError: Result of expression 'Object.defineProperties' [undefined] is not a function
1.6 4 TypeError: Result of expression 'Object.defineProperties' [undefined] is not a function
2.1 7 TypeError: Result of expression 'Object.defineProperties' [undefined] is not a function
2.2 8 true
2.3.3 10 true
2.3.6 x undefined
4.0 14 undefined
4.0.3 15 undefined
4.1.2 16 true
4.2.2 17 true
4.3 18 true
4.4.2 19 true
==========Result=========

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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