fix bad function declaration

Not on global scope, but inside block, which is not allowed in strict mode, causing the compacted version of iD to fail loading.

The bug was introduced by me in #1805, sorry!