Debian Codegraph @

rhino/testsrc/tests/js1_8/regress/regress-459389.js

raw symbols SCIP
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 var gTestfile = 'regress-459389.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 459389;
9 var summary = 'Do not crash with JIT';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 print('mmmm, food!');
17
18 jit(true);
19
20 var SNI = {};
21 SNI.MetaData={};
22 SNI.MetaData.Parameter=function()
23 {
24 var parameters={};
25 this.addParameter=function(key,value)
26 {
27 parameters[key]=[];
28 parameters[key].push(value);
29 };
30 this.getParameter=function(key,separator){
31 if(!parameters[key])
32 {
33 return;
34 }
35 return parameters[key].join(separator);
36 };
37 this.getKeys=function()
38 {
39 return parameters;
40 };
41 };
42 SNI.MetaData.Manager=function(){
43 var m=new SNI.MetaData.Parameter();
44 this.getParameter=m.getParameter;
45 };
46 var MetaDataManager=SNI.MetaData.Manager;
47 SNI.Ads={ };
48 SNI.Ads.Url=function(){
49 var p=new SNI.MetaData.Parameter();
50 this.addParameter=p.addParameter;
51 this.getParameter=p.getParameter;
52 };
53 function Ad() {
54 var url=new SNI.Ads.Url();
55 this.addParameter=url.addParameter;
56 this.getParameter=url.getParameter;
57 }
58 function DartAd()
59 AdUrl.prototype=new Ad();
60 function AdUrl() { }
61 function AdRestriction() {
62 var p=new SNI.MetaData.Parameter();
63 this.addParameter=p.addParameter;
64 this.getParameter=p.getParameter;
65 this.getKeys=p.getKeys;
66 }
67 function AdRestrictionManager(){
68 this.restriction=[];
69 this.isActive=isActive;
70 this.isMatch=isMatch;
71 this.startMatch=startMatch;
72 function isActive(ad,mdm){
73 var value=false;
74 for(var i=0;i<this.restriction.length;i++)
75 {
76 adRestriction=this.restriction[i];
77 value=this.startMatch(ad,mdm,adRestriction);
78 }
79 }
80 function startMatch(ad,mdm,adRestriction){
81 for(var key in adRestriction.getKeys()){
82 var restrictions=adRestriction.getParameter(key,',');
83 var value=mdm.getParameter(key,'');
84 match=this.isMatch(value,restrictions);
85 if(!match){
86 value=ad.getParameter(key,'')
87 match=this.isMatch(value,restrictions);
88 }
89 }
90 }
91 function isMatch(value,restrictions){
92 var match=false;
93 if(value)
94 {
95 splitValue=value.split('');
96 for(var x=0;x<splitValue.length;x++){
97 for(var a;a<restrictions.length;a++){ }
98 }
99 }
100 return match;
101 }
102 }
103 var adRestrictionManager = new AdRestrictionManager();
104 var restrictionLeader6 = new AdRestriction();
105 restrictionLeader6.addParameter("", "");
106 adRestrictionManager.restriction.push(restrictionLeader6);
107 var restrictionLeader7 = new AdRestriction();
108 restrictionLeader7.addParameter("", "");
109 adRestrictionManager.restriction.push(restrictionLeader7);
110 function FoodAd(adtype)
111 {
112 ad=new DartAd()
113 ad.addParameter("",adtype)
114 adRestrictionManager.isActive(ad, mdManager)
115 }
116 var mdManager = new MetaDataManager() ;
117 FoodAd('P')
118
119 jit(false);
120
121 reportCompare(expect, actual, summary);