Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #499 from NipunaMarcus/master
Browse files Browse the repository at this point in the history
Added return to the return statement
  • Loading branch information
maheeka authored Feb 12, 2017
2 parents 0deb941 + 20dfea3 commit 4fead06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/web/js/ballerina/ast/return-statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define(['lodash', 'log', './statement'], function (_, log, Statement) {
*/
var ReturnStatement = function (args) {
Statement.call(this);
this._expression = _.get(args, 'expression') || 'expression';
this._expression = _.get(args, 'return') || 'return';
this.type = "ReturnStatement";
};

Expand Down
3 changes: 3 additions & 0 deletions modules/web/js/ballerina/views/return-statement-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ define(['lodash', 'log', './../ast/return-statement', './simple-statement-view',
};

ReturnStatementView.prototype.updateReturnExpression = function (newReturnExpression, propertyKey) {
if(!newReturnExpression.startsWith("return")){
newReturnExpression = "return "+newReturnExpression;
}
this._model.setReturnExpression(newReturnExpression);
var displayText = this._model.getReturnExpression();
this.renderDisplayText(displayText);
Expand Down

0 comments on commit 4fead06

Please sign in to comment.