xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/v8_features.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1{{header}}
2{{object 1 0}} <<
3  /Type /Catalog
4  /Pages 2 0 R
5  /OpenAction 10 0 R
6>>
7endobj
8{{object 2 0}} <<
9  /Type /Pages
10  /Count 1
11  /Kids [
12    3 0 R
13  ]
14>>
15endobj
16% Page number 0.
17{{object 3 0}} <<
18  /Type /Page
19  /Parent 2 0 R
20  /MediaBox [0 0 612 792]
21>>
22endobj
23% OpenAction action
24{{object 10 0}} <<
25  /Type /Action
26  /S /JavaScript
27  /JS 11 0 R
28>>
29endobj
30% JS program to execute
31{{object 11 0}} <<
32  {{streamlen}}
33>>
34stream
35function expect(str, expected) {
36  try {
37    var result = eval(str);
38    if (result == expected) {
39      app.alert('PASS: ' + str + ' = ' + result);
40    } else {
41      app.alert('FAIL: ' + str + ' = ' + result + ', expected = ' + expected);
42    }
43  } catch (e) {
44    app.alert('ERROR: ' + e.toString());
45  }
46}
47
48try {
49  expect("typeof gc", "function");
50  expect("typeof WebAssembly", "undefined");
51} catch (e) {
52  app.alert('Truly unexpected error: ' + e);
53}
54endstream
55endobj
56{{xref}}
57{{trailer}}
58{{startxref}}
59%%EOF
60