Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/licenses/publicdomain/
5 * Contributor: Matthew Draper <matthew@trebex.net>
6 */
8 var gTestfile = 'regress-564577.js';
9 //-----------------------------------------------------------------------------
10 var BUGNUMBER = 564577;
11 var summary = '__noSuchMethod__ when property exists';
12 var actual = '';
13 var expect = '';
16 //-----------------------------------------------------------------------------
17 test();
18 //-----------------------------------------------------------------------------
20 function test()
21 {
22 enterFunc ('test');
23 printBugNumber(BUGNUMBER);
24 printStatus (summary);
27 var o = {
28 aaa: undefined,
29 bbb: null,
30 ccc: 77,
31 ddd: 'foo',
32 eee: {},
33 fff: /./,
34 __noSuchMethod__: function (id, args)
35 {
36 return(id + '('+args.join(',')+') ' + this[id]);
37 }
38 };
40 status = summary + ' ' + inSection(1) + ' ';
41 actual = o.aaa();
42 expect = 'aaa() undefined';
43 reportCompare(expect, actual, status);
45 status = summary + ' ' + inSection(2) + ' ';
46 try {
47 actual = o.bbb();
48 } catch(e) {
49 actual = e + '';
50 }
51 expect = 'TypeError: o.bbb is not a function';
52 reportCompare(expect, actual, status);
54 status = summary + ' ' + inSection(3) + ' ';
55 try {
56 actual = o.ccc();
57 } catch(e) {
58 actual = e + '';
59 }
60 expect = 'TypeError: o.ccc is not a function';
61 reportCompare(expect, actual, status);
63 status = summary + ' ' + inSection(4) + ' ';
64 try {
65 actual = o.ddd();
66 } catch(e) {
67 actual = e + '';
68 }
69 expect = 'TypeError: o.ddd is not a function';
70 reportCompare(expect, actual, status);
72 status = summary + ' ' + inSection(5) + ' ';
73 try {
74 actual = o.eee();
75 } catch(e) {
76 actual = e + '';
77 }
78 expect = 'TypeError: o.eee is not a function';
79 reportCompare(expect, actual, status);
81 status = summary + ' ' + inSection(6) + ' ';
82 try {
83 actual = o.fff('xyz') + '';
84 } catch(e) {
85 actual = e + '';
86 }
87 expect = 'TypeError: o.fff is not a function';
88 reportCompare(expect, actual, status);
90 exitFunc('test');
91 }