Skip to content

Commit

Permalink
Add missing namespace in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chokobole committed Dec 24, 2019
1 parent c5ca608 commit f960e18
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class Calculator {
int result_;
};

namespace node_binding {

class CalculatorJs : public Napi::ObjectWrap<CalculatorJs> {
public:
void Increment(const Napi::CallbackInfo& info) {
Expand All @@ -100,6 +102,8 @@ class CalculatorJs : public Napi::ObjectWrap<CalculatorJs> {
}
}
};

} // namespace node_binding
```
### Constructor
Expand All @@ -118,6 +122,8 @@ class Calculator {
int result_;
};
namespace node_binding {
class CalculatorJs : public Napi::ObjectWrap<CalculatorJs> {
public:
CalculatorJs(const Napi::CallbackInfo& info)
Expand All @@ -137,6 +143,8 @@ class CalculatorJs : public Napi::ObjectWrap<CalculatorJs> {
private:
std::unique_ptr<Calculator> calculator_;
};
} // namespace node_binding
```

### InstanceAccessor
Expand All @@ -151,6 +159,8 @@ struct Point {
Point(int x = 0, int y = 0) : x(x), y(y) {}
};

namespace node_binding {

class PointJs : public Napi::ObjectWrap<PointJs> {
public:
void SetX(const Napi::CallbackInfo& info, const Napi::Value& v) {
Expand All @@ -172,4 +182,6 @@ class PointJs : public Napi::ObjectWrap<PointJs> {
private:
Point point_;
};

} // namespace node_binding
```

0 comments on commit f960e18

Please sign in to comment.