From 480abdee8a9081d97854023daf56494572ebec80 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 24 Oct 2007 21:51:32 +0000 Subject: [PATCH] For primitive types, the coercive casts never fail. Let's be lenient and let a TypedArray of int work if people fill it with strings like "4" or "9". git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4854 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/streamers/ArrayStreamer.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/io/streamers/ArrayStreamer.as b/src/as/com/threerings/io/streamers/ArrayStreamer.as index 3b68628d9..52f2d8512 100644 --- a/src/as/com/threerings/io/streamers/ArrayStreamer.as +++ b/src/as/com/threerings/io/streamers/ArrayStreamer.as @@ -105,12 +105,12 @@ public class ArrayStreamer extends Streamer out.writeInt(arr.length); if (_elementType == int) { for (ii = 0; ii < arr.length; ii++) { - out.writeInt(arr[ii] as int); + out.writeInt(int(arr[ii])); } } else if (_elementType == Boolean) { for (ii = 0; ii < arr.length; ii++) { - out.writeBoolean(arr[ii] as Boolean); + out.writeBoolean(Boolean(arr[ii])); } } else if (_isFinal) {