~ubuntu-branches/ubuntu/vivid/mozjs24/vivid

« back to all changes in this revision

Viewing changes to js/src/tests/test262/ch13/13.0/S13_A12_T2.js

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2009 the Sputnik authors.  All rights reserved.
 
2
// This code is governed by the BSD license found in the LICENSE file.
 
3
 
 
4
/**
 
5
 * Function declarations in global or function scope are {DontDelete}
 
6
 *
 
7
 * @path ch13/13.0/S13_A12_T2.js
 
8
 * @description Checking if deleting a function that is declared in function scope fails
 
9
 */
 
10
 
 
11
ALIVE="Letov is alive"
 
12
 
 
13
function __cont(){
 
14
 
 
15
    function __func(){
 
16
        return ALIVE;
 
17
    };
 
18
    
 
19
    //////////////////////////////////////////////////////////////////////////////
 
20
    //CHECK#1
 
21
    if (delete __func) {
 
22
        $ERROR('#1: delete __func returning false');
 
23
    }
 
24
    //
 
25
    //////////////////////////////////////////////////////////////////////////////
 
26
    
 
27
    //////////////////////////////////////////////////////////////////////////////
 
28
    //CHECK#2
 
29
    if (__func() !== ALIVE) {
 
30
        $ERROR('#2: __func() === ALIVE. Actual: __func() ==='+__func());
 
31
    }
 
32
    //
 
33
    //////////////////////////////////////////////////////////////////////////////
 
34
};
 
35
 
 
36
__cont();
 
37