re2 1.21.2 → 1.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/addon.cc +4 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -353,6 +353,7 @@ console.log('re2_res : ' + re2_res); // prints: re2_res : abc,a,b,c
|
|
|
353
353
|
|
|
354
354
|
## Release history
|
|
355
355
|
|
|
356
|
+
- 1.21.3 *Fixed an empty string regression reported by [Rhys Arkins](https://github.com/rarkins), thx! Updated deps.*
|
|
356
357
|
- 1.21.2 *Fixed another memory regression reported by [matthewvalentine](https://github.com/matthewvalentine), thx! Updated deps. Added more tests and benchmarks.*
|
|
357
358
|
- 1.21.1 *Fixed a memory regression reported by [matthewvalentine](https://github.com/matthewvalentine), thx! Updated deps.*
|
|
358
359
|
- 1.21.0 *Fixed the performance problem reported by [matthewvalentine](https://github.com/matthewvalentine) (thx!). The change improves performance for multiple use cases.*
|
package/lib/addon.cc
CHANGED
|
@@ -112,7 +112,7 @@ void WrappedRE2::dropCache()
|
|
|
112
112
|
lastStringValue.clear();
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const StrVal&
|
|
115
|
+
const StrVal &WrappedRE2::prepareArgument(const v8::Local<v8::Value> &arg, bool ignoreLastIndex)
|
|
116
116
|
{
|
|
117
117
|
size_t startFrom = ignoreLastIndex ? 0 : lastIndex;
|
|
118
118
|
|
|
@@ -204,12 +204,14 @@ void StrVal::setIndex(size_t newIndex)
|
|
|
204
204
|
index = newIndex;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
static char null_buffer[] = {'\0'};
|
|
208
|
+
|
|
207
209
|
void StrVal::reset(const v8::Local<v8::Value> &arg, size_t argSize, size_t argLength, size_t newIndex, bool buffer)
|
|
208
210
|
{
|
|
209
211
|
clear();
|
|
210
212
|
isBuffer = buffer;
|
|
211
213
|
size = argSize;
|
|
212
214
|
length = argLength;
|
|
213
|
-
data = node::Buffer::Data(arg);
|
|
215
|
+
data = size ? node::Buffer::Data(arg) : null_buffer;
|
|
214
216
|
setIndex(newIndex);
|
|
215
217
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "re2",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.3",
|
|
4
4
|
"description": "Bindings for RE2: fast, safe alternative to backtracking regular expression engines.",
|
|
5
5
|
"homepage": "https://github.com/uhop/node-re2",
|
|
6
6
|
"bugs": "https://github.com/uhop/node-re2/issues",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"install-artifact-from-github": "^1.3.5",
|
|
19
|
-
"nan": "^2.
|
|
19
|
+
"nan": "^2.20.0",
|
|
20
20
|
"node-gyp": "^10.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"build": "node-gyp -j max build",
|
|
35
35
|
"rebuild:dev": "node-gyp -j max rebuild --debug",
|
|
36
36
|
"rebuild": "node-gyp -j max rebuild",
|
|
37
|
-
"clean": "node-gyp clean",
|
|
38
|
-
"
|
|
37
|
+
"clean": "node-gyp clean && node-gyp configure",
|
|
38
|
+
"clean-build": "node-gyp clean"
|
|
39
39
|
},
|
|
40
40
|
"github": "https://github.com/uhop/node-re2",
|
|
41
41
|
"repository": {
|