Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: test/mjsunit/debug-receiver.js

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/debug-multiple-breakpoints.js ('k') | test/mjsunit/debug-referenced-by.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // converted to object for strict mode functions. 78 // converted to object for strict mode functions.
79 function Strict() { "use strict"; debugger; } 79 function Strict() { "use strict"; debugger; }
80 function TestStrict(receiver) { 80 function TestStrict(receiver) {
81 expected_receiver = receiver; 81 expected_receiver = receiver;
82 Strict.call(receiver); 82 Strict.call(receiver);
83 } 83 }
84 84
85 listener_delegate = function(exec_state) { 85 listener_delegate = function(exec_state) {
86 var receiver = exec_state.frame().receiver(); 86 var receiver = exec_state.frame().receiver();
87 assertTrue(!receiver.isObject()); 87 assertTrue(!receiver.isObject());
88 assertEquals(expected_receiver, receiver.value()) 88 assertEquals(expected_receiver, receiver.value());
89 } 89 };
90 90
91 BeginTest("strict: undefined"); TestStrict(undefined); EndTest(); 91 BeginTest("strict: undefined"); TestStrict(undefined); EndTest();
92 BeginTest("strict: null"); TestStrict(null); EndTest(); 92 BeginTest("strict: null"); TestStrict(null); EndTest();
93 BeginTest("strict: 1"); TestStrict(1); EndTest(); 93 BeginTest("strict: 1"); TestStrict(1); EndTest();
94 BeginTest("strict: 1.2"); TestStrict(1.2); EndTest(); 94 BeginTest("strict: 1.2"); TestStrict(1.2); EndTest();
95 BeginTest("strict: 'asdf'"); TestStrict('asdf'); EndTest(); 95 BeginTest("strict: 'asdf'"); TestStrict('asdf'); EndTest();
96 BeginTest("strict: true"); TestStrict(true); EndTest(); 96 BeginTest("strict: true"); TestStrict(true); EndTest();
97 97
98 98
99 // Check that the debugger correctly reflects the object conversion of 99 // Check that the debugger correctly reflects the object conversion of
100 // the receiver for non-strict mode functions. 100 // the receiver for non-strict mode functions.
101 function NonStrict() { debugger; } 101 function NonStrict() { debugger; }
102 function TestNonStrict(receiver) { 102 function TestNonStrict(receiver) {
103 // null and undefined should be transformed to the global object and 103 // null and undefined should be transformed to the global object and
104 // primitives should be wrapped. 104 // primitives should be wrapped.
105 expected_receiver = (receiver == null) ? this : Object(receiver); 105 expected_receiver = (receiver == null) ? this : Object(receiver);
106 NonStrict.call(receiver); 106 NonStrict.call(receiver);
107 } 107 }
108 108
109 listener_delegate = function(exec_state) { 109 listener_delegate = function(exec_state) {
110 var receiver = exec_state.frame().receiver(); 110 var receiver = exec_state.frame().receiver();
111 assertTrue(receiver.isObject()); 111 assertTrue(receiver.isObject());
112 assertEquals(expected_receiver, receiver.value()); 112 assertEquals(expected_receiver, receiver.value());
113 } 113 };
114 114
115 BeginTest("non-strict: undefined"); TestNonStrict(undefined); EndTest(); 115 BeginTest("non-strict: undefined"); TestNonStrict(undefined); EndTest();
116 BeginTest("non-strict: null"); TestNonStrict(null); EndTest(); 116 BeginTest("non-strict: null"); TestNonStrict(null); EndTest();
117 BeginTest("non-strict: 1"); TestNonStrict(1); EndTest(); 117 BeginTest("non-strict: 1"); TestNonStrict(1); EndTest();
118 BeginTest("non-strict: 1.2"); TestNonStrict(1.2); EndTest(); 118 BeginTest("non-strict: 1.2"); TestNonStrict(1.2); EndTest();
119 BeginTest("non-strict: 'asdf'"); TestNonStrict('asdf'); EndTest(); 119 BeginTest("non-strict: 'asdf'"); TestNonStrict('asdf'); EndTest();
120 BeginTest("non-strict: true"); TestNonStrict(true); EndTest(); 120 BeginTest("non-strict: true"); TestNonStrict(true); EndTest();
121 121
122 122
123 assertEquals(begin_test_count, break_count, 123 assertEquals(begin_test_count, break_count,
124 'one or more tests did not enter the debugger'); 124 'one or more tests did not enter the debugger');
125 assertEquals(begin_test_count, end_test_count, 125 assertEquals(begin_test_count, end_test_count,
126 'one or more tests did not have its result checked'); 126 'one or more tests did not have its result checked');
OLDNEW
« no previous file with comments | « test/mjsunit/debug-multiple-breakpoints.js ('k') | test/mjsunit/debug-referenced-by.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698