cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
90 stars 23 forks source link

Prevent `self` variables from leaking into global namespace #291

Closed pkalita-lbl closed 2 years ago

pkalita-lbl commented 2 years ago

Fixes #288

There was a missing step in the instructions of that issue. The problem only occurs after running validation. Prior to this change toolbar.js was leaking the variable self into the global namespace and that variable was overwritten later on by validation.js. The fix is to keep those variables properly scoped.

ddooley commented 2 years ago

Great to catch this. It probably explains behaviour I couldn't figure out, where I was trying to fix function and data references and seemingly having to resort to this." vs. "self. ____ vs this.dh. etc. patches. Looking forward to testing this later today or tomorrow morning.

ddooley commented 2 years ago

Looking good!