Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate tryFinally and tryCatchFinally #10667

Merged
merged 1 commit into from
Mar 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/ember-metal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {
meta,
metaPath,
setMeta,
tryCatchFinally,
tryFinally,
deprecatedTryCatchFinally,
deprecatedTryFinally,
tryInvoke,
typeOf,
uuid,
Expand Down Expand Up @@ -263,12 +263,12 @@ Ember.setMeta = setMeta;
Ember.metaPath = metaPath;
Ember.inspect = inspect;
Ember.typeOf = typeOf;
Ember.tryCatchFinally = tryCatchFinally;
Ember.tryCatchFinally = deprecatedTryCatchFinally;
Ember.isArray = isArray;
Ember.makeArray = makeArray;
Ember.canInvoke = canInvoke;
Ember.tryInvoke = tryInvoke;
Ember.tryFinally = tryFinally;
Ember.tryFinally = deprecatedTryFinally;
Ember.wrap = wrap;
Ember.apply = apply;
Ember.applyStr = applyStr;
Expand Down
16 changes: 15 additions & 1 deletion packages/ember-metal/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ var needsFinallyFix = (function() {
```

@method tryFinally
@deprecated Use JavaScript's native try/finally
@for Ember
@param {Function} tryable The function to run the try callback
@param {Function} finalizer The function to run the finally callback
Expand Down Expand Up @@ -711,6 +712,11 @@ if (needsFinallyFix) {
};
}

var deprecatedTryFinally = function() {
Ember.deprecate("tryFinally is deprecated. Please use JavaScript's native try/finally.", false);
return tryFinally.apply(this, arguments);
};

/**
Provides try/catch/finally functionality, while working
around Safari's double finally bug.
Expand Down Expand Up @@ -741,6 +747,7 @@ if (needsFinallyFix) {
```

@method tryCatchFinally
@deprecated Use JavaScript's native try/catch/finally instead
@for Ember
@param {Function} tryable The function to run the try callback
@param {Function} catchable The function to run the catchable callback
Expand Down Expand Up @@ -791,6 +798,11 @@ if (needsFinallyFix) {
};
}

var deprecatedTryCatchFinally = function() {
Ember.deprecate("tryCatchFinally is deprecated. Please use JavaScript's native try/catch/finally.", false);
return tryCatchFinally.apply(this, arguments);
};

// ........................................
// TYPING & ARRAY MESSAGING
//
Expand Down Expand Up @@ -972,7 +984,9 @@ export {
meta,
typeOf,
tryCatchFinally,
deprecatedTryCatchFinally,
isArray,
canInvoke,
tryFinally
tryFinally,
deprecatedTryFinally
};