Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

$a can override a property/function set by the application #1044

Closed
austinrmiller opened this issue Mar 29, 2017 · 0 comments
Closed

$a can override a property/function set by the application #1044

austinrmiller opened this issue Mar 29, 2017 · 0 comments
Assignees
Labels

Comments

@austinrmiller
Copy link

austinrmiller commented Mar 29, 2017

Augury version (required): 1.4.0
Angular version (required): 4.0.0
Date: 3/29/2017
OS: Mac

Description of issue:
Augury has this code in backend.ts:

const selectedComponentPropertyKey = '$a';

const noSelectedComponentWarningText = 'There is no component selected.';

Object.defineProperty(window, selectedComponentPropertyKey,
  {value: noSelectedComponentWarningText});

But that can easily override a $a property/function used by the application. This is especially likely when using Closure Compiler since it will frequently rename a function to $a, and sometimes that ends up being a function on window. I work at Google where I ran into this.

Steps to reproduce:

  1. Define window.$a to be a function that is called at runtime by the main application
  2. Load the page with Augury installed
  3. Get error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants