| OLD | NEW |
| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 function AcceptArgIsValid(arg) { | 278 function AcceptArgIsValid(arg) { |
| 279 if (IS_UNDEFINED(arg)) | 279 if (IS_UNDEFINED(arg)) |
| 280 return true; | 280 return true; |
| 281 | 281 |
| 282 if (!IS_SPEC_OBJECT(arg) || | 282 if (!IS_SPEC_OBJECT(arg) || |
| 283 !IS_NUMBER(arg.length) || | 283 !IS_NUMBER(arg.length) || |
| 284 arg.length < 0) | 284 arg.length < 0) |
| 285 return false; | 285 return false; |
| 286 | 286 |
| 287 var length = arg.length; | |
| 288 for (var i = 0; i < length; i++) { | |
| 289 if (!IS_STRING(arg[i])) | |
| 290 return false; | |
| 291 } | |
| 292 return true; | 287 return true; |
| 293 } | 288 } |
| 294 | 289 |
| 295 // CallbackInfo's optimized state is just a number which represents its global | 290 // CallbackInfo's optimized state is just a number which represents its global |
| 296 // priority. When a change record must be enqueued for the callback, it | 291 // priority. When a change record must be enqueued for the callback, it |
| 297 // normalizes. When delivery clears any pending change records, it re-optimizes. | 292 // normalizes. When delivery clears any pending change records, it re-optimizes. |
| 298 function CallbackInfoGet(callback) { | 293 function CallbackInfoGet(callback) { |
| 299 return callbackInfoMap.get(callback); | 294 return callbackInfoMap.get(callback); |
| 300 } | 295 } |
| 301 | 296 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 "observe", ArrayObserve, | 559 "observe", ArrayObserve, |
| 565 "unobserve", ArrayUnobserve | 560 "unobserve", ArrayUnobserve |
| 566 )); | 561 )); |
| 567 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( | 562 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( |
| 568 "notify", ObjectNotifierNotify, | 563 "notify", ObjectNotifierNotify, |
| 569 "performChange", ObjectNotifierPerformChange | 564 "performChange", ObjectNotifierPerformChange |
| 570 )); | 565 )); |
| 571 } | 566 } |
| 572 | 567 |
| 573 SetupObjectObserve(); | 568 SetupObjectObserve(); |
| OLD | NEW |