btoews / OctoGAS

GitHub Email Notifications Google Apps Script for Gmail
100 stars 22 forks source link

Fix namespace conflicts #5

Closed btoews closed 10 years ago

btoews commented 10 years ago

I've been getting errors for a few days about class methods not being defined. It was because the namespace is shared between all scripts in a Google Apps Scripts project. The labler and muter scripts both define a Thread class, so depending on the load order, the wrong version would exist when the labler/muter functions ran.

This PR adds back the CoffeeScript top-level function wrapper and adds some sed hackery to rewrite it into a named function that Google likes.

@mislav this should fix the problem you were seeing.