js2 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -1
- data/Rakefile +1 -1
- data/js2.gemspec +1 -1
- data/lib/js2/parser/tokenizer.rb +1 -1
- data/lib/js2/ragel/tokenizer.rl.erb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/js2.gemspec
CHANGED
data/lib/js2/parser/tokenizer.rb
CHANGED
@@ -20,7 +20,7 @@ class JS2::Parser::Tokenizer
|
|
20
20
|
int tokenize (int argc, VALUE *argv, VALUE self) {
|
21
21
|
// convert ruby string to char*
|
22
22
|
VALUE r_str = argv[0];
|
23
|
-
int data_length = RSTRING(r_str)->len;
|
23
|
+
int data_length = #{RUBY_VERSION.match(/^1\.8/) ? "RSTRING(r_str)->len" : "RSTRING_LEN(r_str)"};
|
24
24
|
char* data = STR2CSTR(r_str);
|
25
25
|
|
26
26
|
int in_class = 0;
|
@@ -256,7 +256,7 @@ class JS2::Parser::Tokenizer
|
|
256
256
|
int tokenize (int argc, VALUE *argv, VALUE self) {
|
257
257
|
// convert ruby string to char*
|
258
258
|
VALUE r_str = argv[0];
|
259
|
-
int data_length = RSTRING(r_str)->len;
|
259
|
+
int data_length = #{RUBY_VERSION.match(/^1\.8/) ? "RSTRING(r_str)->len" : "RSTRING_LEN(r_str)"};
|
260
260
|
char* data = STR2CSTR(r_str);
|
261
261
|
|
262
262
|
int in_class = 0;
|