Skip to content

Commit

Permalink
Merge pull request #493 from schungx/v1.2-fixes
Browse files Browse the repository at this point in the history
Fix bug with array methods.
  • Loading branch information
schungx committed Nov 23, 2021
2 parents df07eaa + fa3c679 commit 3393f8a
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- v1.1-fixes
- v1.2-fixes
pull_request: {}

jobs:
Expand Down
23 changes: 12 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Rhai Release Notes
==================

Version 1.2.1
=============

Bug fixes
---------

* Array methods (such as `map`) taking a closure with captures as argument now works properly.


Version 1.2.0
=============

Expand All @@ -9,6 +18,9 @@ Bug fixes with breaking script changes

* As originally intended, function calls with a bang (`!`) now operates directly on the caller's scope, allowing variables inside the scope to be mutated.
* As originally intended, `Engine::XXX_with_scope` API's now properly propagate constants within the provided scope also to _functions_ in the script.
* Printing of integral floating-point numbers is fixed (used to only prints `0.0`).
* `func!()` calls now work properly under `no_closure`.
* Fixed parsing of unary negation such that expressions like `if foo { ... } -x` parses correctly.

New features
------------
Expand Down Expand Up @@ -37,17 +49,6 @@ Deprecated API's
* `From<EvalAltResult>` for `Result<T, Box<EvalAltResult>>` is deprecated so it will no longer be possible to do `EvalAltResult::ErrorXXXXX.into()` to convert to a `Result`; instead, `Err(EvalAltResult:ErrorXXXXX.into())` must be used. Code is clearer if errors are explicitly wrapped in `Err`.


Version 1.1.3
=============

Bug fixes
---------

* Printing of integral floating-point numbers is fixed (used to only prints `0.0`).
* `func!()` calls now work properly under `no_closure`.
* Fixed parsing of unary negation such that expressions like `if foo { ... } -x` parses correctly.


Version 1.1.2
=============

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "codegen"]

[package]
name = "rhai"
version = "1.2.0"
version = "1.2.1"
edition = "2018"
authors = ["Jonathan Turner", "Lukáš Hozda", "Stephen Chung", "jhwgh1968"]
description = "Embedded scripting for Rust"
Expand Down
14 changes: 10 additions & 4 deletions codegen/ui_tests/non_clonable.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
error[E0277]: the trait bound `NonClonable: Clone` is not satisfied
--> ui_tests/non_clonable.rs:11:23
|
11 | pub fn test_fn(input: NonClonable) -> bool {
| ^^^^^^^^^^^ the trait `Clone` is not implemented for `NonClonable`
--> ui_tests/non_clonable.rs:11:23
|
11 | pub fn test_fn(input: NonClonable) -> bool {
| ^^^^^^^^^^^ the trait `Clone` is not implemented for `NonClonable`
|
note: required by a bound in `rhai::Dynamic::cast`
--> $WORKSPACE/src/types/dynamic.rs
|
| pub fn cast<T: Any + Clone>(self) -> T {
| ^^^^^ required by this bound in `rhai::Dynamic::cast`
14 changes: 10 additions & 4 deletions codegen/ui_tests/non_clonable_second.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
error[E0277]: the trait bound `NonClonable: Clone` is not satisfied
--> ui_tests/non_clonable_second.rs:11:27
|
11 | pub fn test_fn(a: u32, b: NonClonable) -> bool {
| ^^^^^^^^^^^ the trait `Clone` is not implemented for `NonClonable`
--> ui_tests/non_clonable_second.rs:11:27
|
11 | pub fn test_fn(a: u32, b: NonClonable) -> bool {
| ^^^^^^^^^^^ the trait `Clone` is not implemented for `NonClonable`
|
note: required by a bound in `rhai::Dynamic::cast`
--> $WORKSPACE/src/types/dynamic.rs
|
| pub fn cast<T: Any + Clone>(self) -> T {
| ^^^^^ required by this bound in `rhai::Dynamic::cast`

0 comments on commit 3393f8a

Please sign in to comment.