Skip to content

Commit e2220aa

Browse files
committed
Fixed array_some example
1 parent cd7172d commit e2220aa

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.laytonsmith.core.exceptions.CRE;
2+
3+
import com.laytonsmith.core.constructs.CArray;
4+
5+
/**
6+
* This is a wrapper around a CArray object that represents an exception.
7+
*/
8+
public class CRECausedByWrapper extends Throwable {
9+
private final CArray exception;
10+
public CRECausedByWrapper(CArray exception){
11+
this.exception = exception.clone();
12+
}
13+
14+
public CArray getException(){
15+
return exception;
16+
}
17+
}

src/main/java/com/laytonsmith/core/functions/ArrayHandling.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,12 +2817,12 @@ public Version since() {
28172817
public ExampleScript[] examples() throws ConfigCompileException {
28182818
return new ExampleScript[]{
28192819
new ExampleScript("Basic usage", "@array = array(2, 4, 8);\n"
2820-
+ "@arrayHasOdds = array_every(@array, closure(@value){\n"
2820+
+ "@arrayHasOdds = array_some(@array, closure(@value){\n"
28212821
+ "\treturn(@value % 2 == 1);\n"
28222822
+ "});\n"
28232823
+ "msg(@arrayHasOdds);"),
2824-
new ExampleScript("Basic usage, with false condition", "@array = array(2, 3, 4);\n"
2825-
+ "@arrayHasOdds = array_every(@array, closure(@value){\n"
2824+
new ExampleScript("Basic usage, with true condition", "@array = array(2, 3, 4);\n"
2825+
+ "@arrayHasOdds = array_some(@array, closure(@value){\n"
28262826
+ "\treturn(@value % 2 == 1);\n"
28272827
+ "});\n"
28282828
+ "msg(@arrayHasOdds);")

0 commit comments

Comments
 (0)