Fixed: When dependent key paths use a relationship, only the first added observer will observe the attribute for the relationship object.
Also, an optimisation on when the willChange… chain is running, there is no need to replace the observers as no new values are set yet. That will be done when the didChange… chain is running.
We expect this method to return a whole number like in Objective-C. This also goes for the related methods, `shortValue`, `longValue` and `longLongValue`.
Also adds more tests (in addition to the existing, already failing test).
Previously a CPPredicate created with format `value == nil` was converted back to `value == <CPNull @ xxxx>`
This patch ensures `predicateFormat` returns `value == nil`
Test added in CPPredicateTest.j
Also added methods and documentation for the new methods:
-trueExpression, -falseExpression and -expressionBlock.
Completed documentation for -predicate and -arguments.
Conditional Expression : an expression using different expressions for
evaluation, depending of a predicate result.
Support for predicate parsing: ```TERNARY(predicate, trueExpression,
falseExpression)```
With init, equal, evaluation, parsing tests.
When the predicate part of a subquery expression was containing
variables, the substitution was ignored.
Now, the subpredicate can contain variables that will be substituted
when calling evaluateWithObject:substitutionVariables:.
Added expression test and predicate parsing test.
Previously, we could only give a selector and a target for perform in the runLoop. Now we can give a block.
This feature is used in the CPTextField class. Previously, when we wanted to call a function at the end of the stack we used window.setTimeout, however due to HTML5 specifications this wasn't called just at the end of the stack but at least 4ms (more information here https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout#Minimum_delay_and_timeout_nesting). Now we give a block to perform, and this block will be performed in the next runloop.
Unittest has been added in Tests/Foundation/CPRunLoopTest.j
Removed the ’release-inline’ option when building as it is not practical to have two different options. The release build now always has inlined msgSend functions. If a release build is needed without inlined msgSend functions an edit of the ”-O2” option to ”-O” in the Jakefile is needed.
This PR adds the feature of CPNotificationQueue.
Cappuccino provides a framework for sending messages between objects within
a process called notifications. CPNotificationQueue objects (or simply notification queues)
act as buffers for notification centers (instances of CPNotificationCenter).
Whereas a notification center distributes notifications when posted,
notifications placed into the queue can be delayed until the end of the current pass through the run loop
or until the run loop is idle. Duplicate notifications can also be coalesced so that only one notification
is sent although multiple notifications are posted. A notification queue maintains notifications
(instances of C¨Notification) generally in a first in first out (FIFO) order.
When a notification rises to the front of the queue, the queue posts it to the notification center,
which in turn dispatches the notification to all objects registered as observers.
More informations here :https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationQueue_Class/index.html#//apple_ref/occ/instm/NSNotificationQueue/enqueueNotification:postingStyle:coalesceMask:forModes:
Unit-Tests in Tests/Foundation/CPNotificationQueueTest.j
In some places the objj_msgSend function is called directly. Most of the times the old slower version is called. This commit will use the never faster version instead.
NEW: CPURLConnection -operation method, CPError CPURLErrorDomain constant.
CPURLConnection -operation gives access to the operation generated by the new CPURLConnection creator.
This allows to create dependencies between operations and setup priorities early.
When the connection fails with a status code 404 or is cancelled, the
operation is also cancelled and
the next operation in the queue is started.