Skip to content

Commit

Permalink
Merge pull request #31 from jessedoyle/type-restriction
Browse files Browse the repository at this point in the history
Fix Type Restriction
  • Loading branch information
jessedoyle authored Feb 1, 2017
2 parents 55af26b + bb1a6c7 commit 14fba85
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v0.10.1 - Jan 31, 2017

- Fix an incorrect type restriction that was causing
compiler issues on recent Crystal versions.
- Fix Sandbox timeout tests by no longer running
a set number of iterations - instead infinite loop
until timeout.

# v0.10.0 - Nov 22, 2016

- Update for Crystal 0.20.0. As shards now copies
Expand Down Expand Up @@ -91,4 +99,4 @@ sbx = Duktape::Sandbox.new(500) # 500 millisecond execution limit

# v0.5.0 - September 8, 2015

- Intial public release.
- Intial public release.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 1.0.0 # your project's version
dependencies:
duktape:
github: jessedoyle/duktape.cr
version: ~> 0.10.0
version: ~> 0.10.1
```
then execute:
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: duktape
version: 0.10.0
version: 0.10.1

authors:
- Jesse Doyle <[email protected]>
Expand Down
7 changes: 2 additions & 5 deletions spec/duktape/sandbox_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@ describe Duktape::Sandbox do

context "timeout during evaluation" do
it "should raise a Duktape::RangeError on timeout" do
sbx = Duktape::Sandbox.new(500)
sbx = Duktape::Sandbox.new(100)
expect_raises Duktape::RangeError, /execution timeout/ do
sbx.eval! <<-JS
var times = 1000000;
for(var i = 0; i < times; i++){
i * i;
}
while (true) {}
JS
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/duktape/api/compile.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Duktape
LibDUK.compile_raw ctx, nil, 0, (flags | LibDUK::COMPILE_SAFE)
end

def compile(str : String, flags : UInt32 = 0)
def compile(str : String, flags : UInt32 = 0_u32)
compile_string str, flags
end

Expand Down
2 changes: 1 addition & 1 deletion src/duktape/version.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Duktape
module VERSION
MAJOR = 0
MINOR = 10
TINY = 0
TINY = 1
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join "."
Expand Down

0 comments on commit 14fba85

Please sign in to comment.