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

Side by Side Diff: src/object-observe.js

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/objects.h » ('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 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 } 388 }
389 389
390 function ObjectGetNotifier(object) { 390 function ObjectGetNotifier(object) {
391 if (!IS_SPEC_OBJECT(object)) 391 if (!IS_SPEC_OBJECT(object))
392 throw MakeTypeError("observe_non_object", ["getNotifier"]); 392 throw MakeTypeError("observe_non_object", ["getNotifier"]);
393 393
394 if (ObjectIsFrozen(object)) return null; 394 if (ObjectIsFrozen(object)) return null;
395 395
396 var objectInfo = objectInfoMap.get(object); 396 var objectInfo = objectInfoMap.get(object);
397 if (IS_UNDEFINED(objectInfo)) { 397 if (IS_UNDEFINED(objectInfo)) objectInfo = CreateObjectInfo(object);
398 objectInfo = CreateObjectInfo(object);
399 %SetIsObserved(object);
400 }
401 398
402 if (IS_NULL(objectInfo.notifier)) { 399 if (IS_NULL(objectInfo.notifier)) {
403 objectInfo.notifier = { __proto__: notifierPrototype }; 400 objectInfo.notifier = { __proto__: notifierPrototype };
404 notifierTargetMap.set(objectInfo.notifier, object); 401 notifierTargetMap.set(objectInfo.notifier, object);
405 } 402 }
406 403
407 return objectInfo.notifier; 404 return objectInfo.notifier;
408 } 405 }
409 406
410 function CallbackDeliverPending(callback) { 407 function CallbackDeliverPending(callback) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 "observe", ArrayObserve, 453 "observe", ArrayObserve,
457 "unobserve", ArrayUnobserve 454 "unobserve", ArrayUnobserve
458 )); 455 ));
459 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( 456 InstallFunctions(notifierPrototype, DONT_ENUM, $Array(
460 "notify", ObjectNotifierNotify, 457 "notify", ObjectNotifierNotify,
461 "performChange", ObjectNotifierPerformChange 458 "performChange", ObjectNotifierPerformChange
462 )); 459 ));
463 } 460 }
464 461
465 SetupObjectObserve(); 462 SetupObjectObserve();
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698