| 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | gTestfile = 'regress-277935.js'; |
| 8 | |
| 9 | START('XML("") should create empty text node'); |
| 10 | printBugNumber(277935); |
| 11 | |
| 12 | // Check that assignments like "a..b = c" causes proper error |
| 13 | |
| 14 | var expect = 'PASS1,PASS2'; |
| 15 | var actual = ''; |
| 16 | |
| 17 | var msg = <foo><bar><s/></bar></foo>; |
| 18 | |
| 19 | try { |
| 20 | eval('msg..s = 0'); |
| 21 | SHOULD_THROW(1); |
| 22 | } catch (e) { |
| 23 | actual += 'PASS1'; |
| 24 | } |
| 25 | |
| 26 | try { |
| 27 | eval('msg..s += 0'); |
| 28 | SHOULD_THROW(2); |
| 29 | } catch (e) { |
| 30 | actual += ',PASS2'; |
| 31 | } |
| 32 | |
| 33 | TEST(1, expect, actual); |
| 34 | END(); |