rasputin 0.10.7 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,73 +0,0 @@
1
- (function(exports) {
2
- // ==========================================================================
3
- // Project: SproutCore
4
- // Copyright: ©2006-2011 Strobe Inc. and contributors.
5
- // Portions ©2008-2011 Apple Inc. All rights reserved.
6
- // License: Licensed under MIT license (see license.js)
7
- // ==========================================================================
8
-
9
- var slice = Array.prototype.slice;
10
-
11
- var respondsTo = function(obj, methodName) {
12
- return !!(obj[methodName] instanceof Function);
13
- };
14
-
15
- /**
16
- @param {Object} obj The object to check for the method
17
- @param {String} methodName The method name to check for
18
- */
19
- SC.respondsTo = respondsTo;
20
-
21
- SC.Object.reopen(
22
- /** @scope SC.Object.prototype */{
23
-
24
- respondsTo: function() {
25
- var args = slice.call(arguments);
26
- args.unshift(this);
27
- return SC.respondsTo.apply(SC, args);
28
- }
29
-
30
- });
31
-
32
- // ==========================================================================
33
- // Project: SproutCore
34
- // Copyright: ©2006-2011 Strobe Inc. and contributors.
35
- // Portions ©2008-2011 Apple Inc. All rights reserved.
36
- // License: Licensed under MIT license (see license.js)
37
- // ==========================================================================
38
-
39
- var slice = Array.prototype.slice;
40
-
41
- var tryToPerform = function(obj, methodName) {
42
- var args = slice.call(arguments);
43
- args.shift(); args.shift();
44
- return SC.respondsTo(obj, methodName) && (obj[methodName].apply(obj, args) !== false);
45
- };
46
-
47
- /**
48
- Checks to see if the `methodName` exists on the `obj`,
49
- and if it does, invokes it with the arguments passed.
50
-
51
- @function
52
-
53
- @param {Object} obj The object to check for the method
54
- @param {String} methodName The method name to check for
55
- @param {Object...} args The arguments to pass to the method
56
-
57
- @returns {Boolean} true if the method does not return false
58
- @returns {Boolean} false otherwise
59
- */
60
- SC.tryToPerform = tryToPerform;
61
-
62
- SC.Object.reopen(
63
- /** @scope SC.Object.prototype */{
64
-
65
- tryToPerform: function() {
66
- var args = slice.call(arguments);
67
- args.unshift(this);
68
- return SC.tryToPerform.apply(SC, args);
69
- }
70
-
71
- });
72
-
73
- })({})