summaryrefslogtreecommitdiff
path: root/test/language/expressions/assignment/11.13.1-1-3.js
blob: 1969b2a7f85a61a3e1bd7514d13dc9a60b5c7227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: PutValue operates only on references (see step 1).
es5id: 11.13.1-1-3
description: >
    simple assignment throws ReferenceError if LeftHandSide is not a
    reference (boolean)
includes: [runTestCase.js]
---*/

function testcase() {
  try {
    eval("true = 42");
  }
  catch (e) {
    if (e instanceof ReferenceError) {
      return true;
    }
  }
 }
runTestCase(testcase);