xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/bug_361.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1{{header}}
2{{object 1 0}} <<
3  /Type /Catalog
4  /Pages 2 0 R
5  /AcroForm 4 0 R
6  /OpenAction 10 0 R
7>>
8endobj
9{{object 2 0}} <<
10  /Type /Pages
11  /Count 1
12  /Kids [
13    3 0 R
14  ]
15>>
16endobj
17% Page number 0.
18{{object 3 0}} <<
19  /Type /Page
20  /Parent 2 0 R
21  /Resources <<
22    /Font <</F1 15 0 R>>
23  >>
24  /Contents [21 0 R]
25  /MediaBox [0 0 612 792]
26>>
27endobj
28% Forms
29{{object 4 0}} <<
30  /Fields [5 0 R]
31>>
32endobj
33% Field
34{{object 5 0}} <<
35 /FT /Tx
36 /T (MyField)
37 /Type /Annot
38 /Subtype /Widget
39 /Rect [100 200 150 250]
40>>
41endobj
42% OpenAction action
43{{object 10 0}} <<
44  /Type /Action
45  /S /JavaScript
46  /JS 11 0 R
47>>
48endobj
49% JS program to execute
50{{object 11 0}} <<
51  {{streamlen}}
52>>
53stream
54function testField(x) {
55  var field = this.getField("MyField");
56  field.value = x;
57  var y = field.value;
58  app.alert("Answer for \"" + x + "\" is: " + typeof(y) + " " + y);
59}
60testField("");
61testField("goats");
62testField("b4");
63testField("b4.5");
64testField("4x");
65testField("4.5x");
66testField(4);
67testField("4");
68testField(" 4");
69testField("4 ");
70testField("                          4                                      ");
71testField("4 3 2 1");
72testField("-4");
73testField("23.00000001");
74testField("23.00000000000000001");
75testField(40000000000000000000000000);
76testField("40000000000000000000000000");
77testField("25,5");
78testField("1e+5");
79testField("1e5");
80testField("1e-5");
81testField("-1e-5");
82testField("1.2e5");
83testField(Infinity);
84testField("Infinity");
85testField("INFINITY");
86testField("INF");
87testField(NaN);
88testField("NaN");
89testField("NAN");
90testField("0x100");
91testField("0x100.1");
92testField("0x100,1");
93testField("0x100x1");
94testField("123x6");
95testField("123xy6");
96testField("123.y6");
97testField("1,000,000");
98testField("1.2.3");
99testField("1-3");
100testField("1+3");
101testField("1.-3");
102testField("1.+3");
103testField([1, 2, 3, 4]);
104testField("[1, 2, 3, 4]");
105testField({a: 1, b: 2});
106testField("{a: 1, b: 2}");
107testField(function(x) { return x+1; });
108testField("function(x) { return x+1; }");
109endstream
110endobj
111{{xref}}
112{{trailer}}
113{{startxref}}
114%%EOF
115