~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/tests/js1_5/Regress/regress-185165.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
 * Date:    13 Dec 2002
 
9
 * SUMMARY: Decompilation of "\\" should give "\\"
 
10
 * See http://bugzilla.mozilla.org/show_bug.cgi?id=185165
 
11
 *
 
12
 */
 
13
//-----------------------------------------------------------------------------
 
14
var UBound = 0;
 
15
var BUGNUMBER = 185165;
 
16
var summary = 'Decompilation of "\\\\" should give "\\\\"';
 
17
var status = '';
 
18
var statusitems = [];
 
19
var actual = '';
 
20
var actualvalues = [];
 
21
var expect= '';
 
22
var expectedvalues = [];
 
23
 
 
24
 
 
25
// Check that second decompilation of script gives the same string as first one
 
26
var f1 = function() { return "\\"; }
 
27
  var s1 = f1.toString();
 
28
 
 
29
var f2;
 
30
eval("f2=" + s1);
 
31
var s2 = f2.toString();
 
32
 
 
33
status = inSection(1);
 
34
actual = s2;
 
35
expect = s1;
 
36
addThis();
 
37
 
 
38
 
 
39
 
 
40
//-----------------------------------------------------------------------------
 
41
test();
 
42
//-----------------------------------------------------------------------------
 
43
 
 
44
 
 
45
 
 
46
function addThis()
 
47
{
 
48
  statusitems[UBound] = status;
 
49
  actualvalues[UBound] = actual;
 
50
  expectedvalues[UBound] = expect;
 
51
  UBound++;
 
52
}
 
53
 
 
54
 
 
55
function test()
 
56
{
 
57
  enterFunc('test');
 
58
  printBugNumber(BUGNUMBER);
 
59
  printStatus(summary);
 
60
 
 
61
  for (var i=0; i<UBound; i++)
 
62
  {
 
63
    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
 
64
  }
 
65
 
 
66
  exitFunc ('test');
 
67
}