Skip to content

Improve module environment inheritance with a Object.create like #869

@leobalter

Description

@leobalter

Ref #859 (comment)

Instead of using QUnit's extend method to extend a module's env. inheritance, we should improve it with a Object.create's like inheritance.

Suggested by @gibson042:

var createObject = (function( Base ) {
    return function( prototype ) {
        Base.prototype = prototype;
        return new Base();
    };
})( Function() );

env = createObject( parentModule.testEnvironment );

We could also use Object.create adding a polyfill that would be used only on IE6~IE8 for the supported browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: DeclinedStatus: ReadyA "Meta" type issue that has reached consensus.Type: EnhancementNew idea or feature request.Type: MetaSeek input from maintainers and contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions