When we use the term "code reuse" it generally does not mean copy-and-pasting the arguments list from another method, copy-and-pasting a try/catch block from another method, and copy-and-pasting a switch statement handling only one (the default) case. No, that's we call write only coding: never stopping to read what you just wrote. And Stan James's colleague seems to have perfected the technique ...

function hotKeyFired(sKeyId, lKey, iModifier, sKeyTxt) {
  var id;
  try {
    switch (sKeyId) {
      default:
        try{
          eval(sKeyId);
        } catch(e) {}
          break;
    }
  } catch(e) {
    throw e;
  } finally {
    id = null;
  }
}

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!