Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

the _propCache and _attrCache were twisted. #610

Closed
@LeoYuan

Description

@LeoYuan

bug description

the internal variables _propCache and _attrCache are twisted, so some code went wrong.

how to reproduce?

af('body').prop('tagName');
af('body').data('key', {a: 3});
af('body').prop('tagName');

how to fix?

to add one more judgement to make code much more robust.

var val = (this[0].afmCacheId && _attrCache[this[0].afmCacheId][attr]) ? (this[0].afmCacheId && _attrCache[this[0].afmCacheId][attr]) : this[0].getAttribute(attr);

changed to

var val = (this[0].afmCacheId && _attrCache[this[0].afmCacheId] && _attrCache[this[0].afmCacheId][attr]) ? _attrCache[this[0].afmCacheId][attr] : this[0].getAttribute(attr);

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