Merge pull request #1005 from ethereum/modifierbody

Require ";" after "_"
This commit is contained in:
Yoichi Hirai
2016-09-05 18:28:32 +02:00
committed by GitHub
13 changed files with 69 additions and 59 deletions
+7 -7
View File
@@ -148,10 +148,10 @@ restrictions highly readable.
{
if (msg.sender != _account)
throw;
// Do not forget the "_"! It will
// Do not forget the "_;"! It will
// be replaced by the actual function
// body when the modifier is invoked.
_
_;
}
/// Make `_newOwner` the new owner of this
@@ -164,7 +164,7 @@ restrictions highly readable.
modifier onlyAfter(uint _time) {
if (now < _time) throw;
_
_;
}
/// Erase ownership information.
@@ -187,7 +187,7 @@ restrictions highly readable.
modifier costs(uint _amount) {
if (msg.value < _amount)
throw;
_
_;
if (msg.value > _amount)
msg.sender.send(msg.value - _amount);
}
@@ -286,7 +286,7 @@ function finishes.
modifier atStage(Stages _stage) {
if (stage != _stage) throw;
_
_;
}
function nextStage() internal {
@@ -304,7 +304,7 @@ function finishes.
now >= creationTime + 12 days)
nextStage();
// The other stages transition by transaction
_
_;
}
// Order of the modifiers matters here!
@@ -328,7 +328,7 @@ function finishes.
// automatically.
modifier transitionNext()
{
_
_;
nextStage();
}
+3 -3
View File
@@ -321,7 +321,7 @@ inheritable properties of contracts and may be overridden by derived contracts.
modifier onlyOwner {
if (msg.sender != owner)
throw;
_
_;
}
}
@@ -341,7 +341,7 @@ inheritable properties of contracts and may be overridden by derived contracts.
// Modifiers can receive arguments:
modifier costs(uint price) {
if (msg.value >= price) {
_
_;
}
}
}
@@ -367,7 +367,7 @@ inheritable properties of contracts and may be overridden by derived contracts.
modifier noReentrancy() {
if (locked) throw;
locked = true;
_
_;
locked = false;
}
+2 -2
View File
@@ -403,8 +403,8 @@ high or low invalid bids.
/// functions. `onlyBefore` is applied to `bid` below:
/// The new function body is the modifier's body where
/// `_` is replaced by the old function body.
modifier onlyBefore(uint _time) { if (now >= _time) throw; _ }
modifier onlyAfter(uint _time) { if (now <= _time) throw; _ }
modifier onlyBefore(uint _time) { if (now >= _time) throw; _; }
modifier onlyAfter(uint _time) { if (now <= _time) throw; _; }
function BlindAuction(
uint _biddingTime,