sqreen-alt 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e911ef9a6f8fc1dff0ec458f44860f9c43acce72c704f48865e7170dbf5e99f
4
- data.tar.gz: 6df56f16bfdddcdbf28b68b23c75d904a5a736d77ba9f4d4cef8b7ac7ef373e3
3
+ metadata.gz: 57fbf5dd32eefb6b656d3faf05b0f352ede30960e86496dd1551c52d2806a2fb
4
+ data.tar.gz: 56cd5bcb1ccc2d3c4cc8b0c6d5cfdbfb44e137e9b51ca9a9e0af47d44fb3f79c
5
5
  SHA512:
6
- metadata.gz: 7985d8110bf3fb387fd14d17938e46439a33e503bb704dd801156d16444944e6a2e5df4a1fca0e736cc8e624bea365440573857af17985d51fd2acf6ac82fa8a
7
- data.tar.gz: 80a78aa06bbfedbcd1a27c5b64877e4022669aac3ac6a4c5fdcfa458508c43936076ea1111804f9e57cfe1f8d446e3f4083709613d8a432e7582b2c57b9e5fef
6
+ metadata.gz: 3ae9b65ef690fb571339996e2ac66e36efe8c9d7099d5009cbc042474ce01a08a4fd40d769644f74db169540f4701a08fbf5d374db605ae8a14f5914e30425f9
7
+ data.tar.gz: b29257450a6a567b885e11c045d80d15c2cdbbcb3a70d8f16591478dd21008392a752415c35b67e9d73106cd61b2b57b63ca7e5e2b3b45110f89a2ed2c046a5e
@@ -14,6 +14,7 @@ else
14
14
  end
15
15
  end
16
16
 
17
+ require 'weakref'
17
18
  require 'execjs'
18
19
 
19
20
  require 'sqreen/rule_attributes'
@@ -41,6 +42,8 @@ module Sqreen
41
42
  build_runnable(callbacks)
42
43
  if !SQREEN_V8_THREAD
43
44
  @compiled = ExecJS.compile(@source)
45
+ else
46
+ @runtimes = []
44
47
  end
45
48
  @restrict_max_depth = 20
46
49
  end
@@ -144,7 +147,11 @@ module Sqreen
144
147
 
145
148
  def call_callback(name, inst, args, rv = nil)
146
149
  if SQREEN_V8_THREAD
147
- Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"] ||= ExecJS.compile(@source)
150
+ if Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"].nil? || !Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"].weakref_alive?
151
+ runtime = ExecJS.compile(@source)
152
+ @runtimes.push runtime
153
+ Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"] = WeakRef.new(runtime)
154
+ end
148
155
  end
149
156
  ret = nil
150
157
  args_override = nil
data/lib/sqreen/runner.rb CHANGED
@@ -169,7 +169,7 @@ module Sqreen
169
169
  Sqreen.log.debug do
170
170
  format('rules: %s', rules.
171
171
  sort_by { |r| r['name'] }.
172
- map { |r| format('(%s, %s)', r['name'], r.to_json.size) }.
172
+ map { |r| format('(%s, %s, %s)', r[Rules::Attrs::NAME], r.to_json.size, r[Rules::Attrs::BLOCK]) }.
173
173
  join(', '))
174
174
  end
175
175
  [rulespack_id, rules]
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  module Sqreen
4
- VERSION = '1.10.0'.freeze
4
+ VERSION = '1.10.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen-alt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen