sqreen 1.10.0-java → 1.10.1-java

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: 9ddf2c0f35a8ee5a30253430edb9a7ba8316870018c306273c5beb2a7d802777
4
- data.tar.gz: b1b64ccd659f142389934d2a2ec6e30bedffd95f83f2f96a30333979cc8cd80d
3
+ metadata.gz: 2769174da57177a2fb014d06f5c810f35d1b011e0b84640b935079f83bc01153
4
+ data.tar.gz: 06be029bc2497b2e1f5eb2f6993f09c4f0ad0dae8597ecd62e1d7ec6b3470f54
5
5
  SHA512:
6
- metadata.gz: 74bc35df0b7114e50d4c618787553e916130ee69870c35ace9b881ffefa360866f075071c802952d18483696ec6fab20c3830cfd65a45365eb51e9f15ee66250
7
- data.tar.gz: 5d2842f3376b7b9951cb366a763c4b3ab5a5854b100b7db477d9c137d5f8552c76da47b1395d1c10e07bb5be1b409fec1b6bff4ea90033fa1b559befe7d10728
6
+ metadata.gz: 19804e889ab4f9aadacaac5d87805c2bb7873f62f95b30829367752a224a7ec9f12d4a31ebccde3ffda21584c6483473c17dfe18c573ec4f393f9e3f1e17fead
7
+ data.tar.gz: c85dea9e1a61cfb25dcb278213fbb344344f4a5932425b49b80d8375d75a68a7c4042af88d5d700ec65945246014fe14e48f1ceee9eb125d4e3472d3e3ad9909
@@ -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
@@ -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
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: java
6
6
  authors:
7
7
  - Sqreen