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

Side by Side Diff: test/mjsunit/mirror-object.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/mirror-function.js ('k') | test/mjsunit/mirror-regexp.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 assertEquals('property', global_mirror.property("Math").type()); 183 assertEquals('property', global_mirror.property("Math").type());
184 assertFalse(global_mirror.property("Math").isEnum(), "Math is enumerable" + glob al_mirror.property("Math").attributes()); 184 assertFalse(global_mirror.property("Math").isEnum(), "Math is enumerable" + glob al_mirror.property("Math").attributes());
185 185
186 math_mirror = global_mirror.property("Math").value(); 186 math_mirror = global_mirror.property("Math").value();
187 assertEquals('property', math_mirror.property("E").type()); 187 assertEquals('property', math_mirror.property("E").type());
188 assertFalse(math_mirror.property("E").isEnum(), "Math.E is enumerable"); 188 assertFalse(math_mirror.property("E").isEnum(), "Math.E is enumerable");
189 assertTrue(math_mirror.property("E").isReadOnly()); 189 assertTrue(math_mirror.property("E").isReadOnly());
190 assertFalse(math_mirror.property("E").canDelete()); 190 assertFalse(math_mirror.property("E").canDelete());
191 191
192 // Test objects with JavaScript accessors. 192 // Test objects with JavaScript accessors.
193 o = {} 193 o = {};
194 o.__defineGetter__('a', function(){return 'a';}); 194 o.__defineGetter__('a', function(){return 'a';});
195 o.__defineSetter__('b', function(){}); 195 o.__defineSetter__('b', function(){});
196 o.__defineGetter__('c', function(){throw 'c';}); 196 o.__defineGetter__('c', function(){throw 'c';});
197 o.__defineSetter__('c', function(){throw 'c';}); 197 o.__defineSetter__('c', function(){throw 'c';});
198 testObjectMirror(o, 'Object', 'Object'); 198 testObjectMirror(o, 'Object', 'Object');
199 mirror = debug.MakeMirror(o); 199 mirror = debug.MakeMirror(o);
200 // a has getter but no setter. 200 // a has getter but no setter.
201 assertTrue(mirror.property('a').hasGetter()); 201 assertTrue(mirror.property('a').hasGetter());
202 assertFalse(mirror.property('a').hasSetter()); 202 assertFalse(mirror.property('a').hasSetter());
203 assertEquals(debug.PropertyType.Callbacks, mirror.property('a').propertyType()); 203 assertEquals(debug.PropertyType.Callbacks, mirror.property('a').propertyType());
(...skipping 19 matching lines...) Expand all
223 223
224 // Test objects with native accessors. 224 // Test objects with native accessors.
225 mirror = debug.MakeMirror(new String('abc')); 225 mirror = debug.MakeMirror(new String('abc'));
226 assertTrue(mirror instanceof debug.ObjectMirror); 226 assertTrue(mirror instanceof debug.ObjectMirror);
227 assertFalse(mirror.property('length').hasGetter()); 227 assertFalse(mirror.property('length').hasGetter());
228 assertFalse(mirror.property('length').hasSetter()); 228 assertFalse(mirror.property('length').hasSetter());
229 assertTrue(mirror.property('length').isNative()); 229 assertTrue(mirror.property('length').isNative());
230 assertEquals('a', mirror.property(0).value().value()); 230 assertEquals('a', mirror.property(0).value().value());
231 assertEquals('b', mirror.property(1).value().value()); 231 assertEquals('b', mirror.property(1).value().value());
232 assertEquals('c', mirror.property(2).value().value()); 232 assertEquals('c', mirror.property(2).value().value());
OLDNEW
« no previous file with comments | « test/mjsunit/mirror-function.js ('k') | test/mjsunit/mirror-regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698