Skip to content

Usage of this in DOMPropertyOperations module breaks build in Closure Compiler under advanced optimizations #8887

@roman01la

Description

@roman01la

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
Referring to object's method from a another method within same object, this.deleteValueForProperty(node, name);, here, breaks React build in Closure Compiler under advanced optimizations.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).
Build a React app using Closure Compiler in advanced mode. (Unfortunately I can not provide a source of the app where I got this bug.)

What is the expected behavior?
An app built with Closure Compiler in advanced mode should not throw this.deleteValueForProperty is not a function exception

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React v15.4.2

Changing this.deleteValueForProperty to DOMPropertyOperations.deleteValueForProperty solves this issue. There are other methods of DOMPropertyOperations object which are using deleteValueForProperty properly via DOMPropertyOperations.deleteValueForProperty call.

If this makes sense, I'll prepare a PR.

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