Const Correctness for String::Value

Patch by Patrick Gansterer <paroga@paroga.com>.
Review at http://codereview.chromium.org/199043.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ab54e953
......@@ -17,3 +17,4 @@ Paolo Giarrusso <p.giarrusso@gmail.com>
Rafal Krypa <rafal@krypa.net>
Rene Rebe <rene@exactcode.de>
Ryan Dahl <coldredlemur@gmail.com>
Patrick Gansterer <paroga@paroga.com>
......@@ -979,8 +979,9 @@ class V8EXPORT String : public Primitive {
public:
explicit Utf8Value(Handle<v8::Value> obj);
~Utf8Value();
char* operator*() const { return str_; }
int length() { return length_; }
char* operator*() { return str_; }
const char* operator*() const { return str_; }
int length() const { return length_; }
private:
char* str_;
int length_;
......@@ -1001,8 +1002,9 @@ class V8EXPORT String : public Primitive {
public:
explicit AsciiValue(Handle<v8::Value> obj);
~AsciiValue();
char* operator*() const { return str_; }
int length() { return length_; }
char* operator*() { return str_; }
const char* operator*() const { return str_; }
int length() const { return length_; }
private:
char* str_;
int length_;
......@@ -1023,7 +1025,8 @@ class V8EXPORT String : public Primitive {
explicit Value(Handle<v8::Value> obj);
~Value();
uint16_t* operator*() const { return str_; }
int length() { return length_; }
const uint16_t* operator*() { return str_; }
int length() const { return length_; }
private:
uint16_t* str_;
int length_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment