mozilla/rhino — pull request #83 by anba (2012-08-21 19:18:10+00:00)
Title: Patch for Bug 784358 ("Defining const variable within eval() throws redeclaration error")

initScript() only needs to special case the 'var' case for eval'ed code. Also throw a catchable TypeError when redeclaring a constant instead of calling Context.reportRuntimeError1().