forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accessor.js
54 lines (48 loc) · 2.06 KB
/
accessor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the LICENSE
// file in the root directory of this source tree.
//
// RUN: %hdb --break-at-start < %s.step-in.debug %s | %FileCheck --match-full-lines %s --check-prefix=CHECK-STEP-IN
// RUN: %hdb --break-at-start < %s.step-over.debug %s | %FileCheck --match-full-lines %s --check-prefix=CHECK-STEP-OVER
// RUN: %hdb --break-at-start %s < %s.step.debug | %FileCheck --match-full-lines %s --check-prefix=CHECK-STEP
// RUN: %hdb --break-at-start %s < %s.finish.debug | %FileCheck --match-full-lines %s --check-prefix=CHECK-FINISH
// REQUIRES: debugger
var obj = {
a: 'a',
get aLen() {
print("hello");
return this.a.length;
}
};
var alen = obj.aLen + 1;
print(alen);
// CHECK-STEP-OVER: Break on script load in global: {{.*}}:12:1
// CHECK-STEP-OVER: Stepped to global: {{.*}}:12:11
// CHECK-STEP-OVER: Stepped to global: {{.*}}:20:12
// CHECK-STEP-OVER: hello
// CHECK-STEP-OVER: Stepped to global: {{.*}}:21:1
// CHECK-STEP-OVER: 2
// CHECK-STEP-IN: Break on script load in global: {{.*}}:12:1
// CHECK-STEP-IN: Stepped to global: {{.*}}:12:11
// CHECK-STEP-IN: Stepped to global: {{.*}}:20:12
// CHECK-STEP-IN: Stepped to get aLen: {{.*}}:15:9
// CHECK-STEP-IN: hello
// CHECK-STEP-IN: Stepped to get aLen: {{.*}}:16:20
// CHECK-STEP: Break on script load in global: {{.*}}:12:1
// CHECK-STEP: Set breakpoint 1 at {{.*}}:15:9
// CHECK-STEP: Continuing execution
// CHECK-STEP: Break on breakpoint 1 in get aLen: {{.*}}:15:9
// CHECK-STEP: hello
// CHECK-STEP: Stepped to get aLen: {{.*}}:16:20
// CHECK-STEP: Stepped to global: {{.*}}:20:12
// CHECK-STEP: Stepped to global: {{.*}}:21:1
// CHECK-STEP: 2
// CHECK-FINISH: Break on script load in global: {{.*}}:12:1
// CHECK-FINISH: Set breakpoint 1 at {{.*}}:15:9
// CHECK-FINISH: Continuing execution
// CHECK-FINISH: Break on breakpoint 1 in get aLen: {{.*}}:15:9
// CHECK-FINISH: hello
// CHECK-FINISH: Stepped to global: {{.*}}:20:12
// CHECK-FINISH: Stepped to global: {{.*}}:21:1
// CHECK-FINISH: 2