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

Side by Side Diff: test/mjsunit/mirror-object.js

Issue 1938663002: [debugger] Add JSProxy support in Runtime::GetInternalProperties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 assertTrue("[[BoundThis]]" in property_map); 259 assertTrue("[[BoundThis]]" in property_map);
260 assertEquals("function", property_map["[[BoundThis]]"].value().type()); 260 assertEquals("function", property_map["[[BoundThis]]"].value().type());
261 assertEquals(Array, property_map["[[BoundThis]]"].value().value()); 261 assertEquals(Array, property_map["[[BoundThis]]"].value().value());
262 assertTrue("[[TargetFunction]]" in property_map); 262 assertTrue("[[TargetFunction]]" in property_map);
263 assertEquals("function", property_map["[[TargetFunction]]"].value().type()); 263 assertEquals("function", property_map["[[TargetFunction]]"].value().type());
264 assertEquals(Number, property_map["[[TargetFunction]]"].value().value()); 264 assertEquals(Number, property_map["[[TargetFunction]]"].value().value());
265 assertTrue("[[BoundArgs]]" in property_map); 265 assertTrue("[[BoundArgs]]" in property_map);
266 assertEquals("object", property_map["[[BoundArgs]]"].value().type()); 266 assertEquals("object", property_map["[[BoundArgs]]"].value().type());
267 assertEquals(1, property_map["[[BoundArgs]]"].value().value().length); 267 assertEquals(1, property_map["[[BoundArgs]]"].value().value().length);
268
269 // Test JSProxy internal properties.
270 var target = {};
271 var handler = {
272 get: function (target, name, receiver) {
273 return target[name];
274 },
275 set: function(target, name, value, receiver) {
276 target[name] = value;
277 return value;
278 }
279 }
280 ip = debug.ObjectMirror.GetInternalProperties(new Proxy(target, handler));
281 assertEquals(3, ip.length);
282 var property_map = {};
283 for (var i = 0; i < ip.length; i++) {
284 property_map[ip[i].name()] = ip[i];
285 }
286 assertTrue("[[Target]]" in property_map);
287 assertEquals(target, property_map["[[Target]]"].value().value());
288 assertTrue("[[Handler]]" in property_map);
289 assertEquals(handler, property_map["[[Handler]]"].value().value());
290 assertTrue("[[IsRevoked]]" in property_map);
291 assertEquals(false, property_map["[[IsRevoked]]"].value().value());
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698