~ubuntu-branches/ubuntu/trusty/mozjs17/trusty

« back to all changes in this revision

Viewing changes to js/src/tests/ecma_2/Exceptions/lexical-015.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* This Source Code Form is subject to the terms of the Mozilla Public
 
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
5
 
 
6
 
 
7
/**
 
8
   File Name:          lexical-015.js
 
9
   Corresponds To:     7.4.3-8-n.js
 
10
   ECMA Section:       7.4.3
 
11
 
 
12
   Description:
 
13
   The following words are used as keywords in proposed extensions and are
 
14
   therefore reserved to allow for the possibility of future adoption of
 
15
   those extensions.
 
16
 
 
17
   FutureReservedWord :: one of
 
18
   case    debugger    export      super
 
19
   catch   default     extends     switch
 
20
   class   do          finally     throw
 
21
   const   enum        import      try
 
22
 
 
23
   Author:             christine@netscape.com
 
24
   Date:               12 november 1997
 
25
*/
 
26
var SECTION = "lexical-015";
 
27
var VERSION = "JS1_4";
 
28
var TITLE   = "Future Reserved Words";
 
29
 
 
30
startTest();
 
31
writeHeaderToLog( SECTION + " "+ TITLE);
 
32
 
 
33
var result = "Failed";
 
34
var exception = "No exception thrown";
 
35
var expect = "Passed";
 
36
 
 
37
try {
 
38
  eval("switch = true;");
 
39
} catch ( e ) {
 
40
  result = expect;
 
41
  exception = e.toString();
 
42
}
 
43
 
 
44
new TestCase(
 
45
  SECTION,
 
46
  "switch = true" +
 
47
  " (threw " + exception +")",
 
48
  expect,
 
49
  result );
 
50
 
 
51
test();
 
52
 
 
53