Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 475561018D for ; Mon, 1 Jul 2013 23:21:20 +0000 (UTC) Received: (qmail 93969 invoked by uid 500); 1 Jul 2013 23:21:20 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 93870 invoked by uid 500); 1 Jul 2013 23:21:20 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 93862 invoked by uid 99); 1 Jul 2013 23:21:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 23:21:19 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.223.182] (HELO mail-ie0-f182.google.com) (209.85.223.182) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 23:21:13 +0000 Received: by mail-ie0-f182.google.com with SMTP id s9so10643497iec.27 for ; Mon, 01 Jul 2013 16:20:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version:x-mailer:x-gm-message-state; bh=AkSkMG1u3iUGDamsrILjGQXNCRLC06KMcfSfK/fYcvY=; b=dZ49te1L1I0y3GtI9VUR/HiZv9HzlmF1DFPnXtIkv523XDKTbJF6br4+0AXtvi9ywK 9P8Q13qpUt69Ia33gsYymdRA2uT8Ea2PZ0cU4Iau9APK3IzD+TdjL/F9zSHxf6CNh4N1 917qRN9oW4d632Y46rVRa8MGu7do70zWVn9ydEFJqbf5FE8P7G5a9ANX6RY0qs4EsMhh saGlXCN7IihESjIQKX8E5wbxqx0CDU73hTrs0m3mkjMBIF72QUHOj+xQ2UWOXjAhEHrA qfNiicuV2pWggvIIE9xQd9snE8hmQTiyzOzZLJGluDKbhQI49NGyTJpbt9hTvjgO6HYy XtHg== X-Received: by 10.50.225.67 with SMTP id ri3mr17559918igc.35.1372720833397; Mon, 01 Jul 2013 16:20:33 -0700 (PDT) Received: from [10.0.1.5] (SCZ-190-104-11-00206.wimaxtigo.bo. [190.104.11.206]) by mx.google.com with ESMTPSA id p5sm15462815igj.9.2013.07.01.16.20.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 16:20:32 -0700 (PDT) From: Tyler Wilson Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: ArrayBuffer support for Cordova OS X ? Message-Id: <7BC4F01B-2E18-4F32-B7A0-D4A30A95FA16@pulse-robotics.com> Date: Mon, 1 Jul 2013 19:20:20 -0400 To: dev@cordova.apache.org Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) X-Mailer: Apple Mail (2.1508) X-Gm-Message-State: ALoCoQmAaNV66vcLM89ScfU/vQHkzzYIEWQCcL37cfsDVAdDC80hv5WbN/NgNFkoRf2bVmXmHYn4 X-Virus-Checked: Checked by ClamAV on apache.org Good day, I just signed up to the mailing list, though I have been a very happy = user of Cordova for a while now. I am working on a plugin for Cordova, = and have thus far developed on iOS, and everything is fine. I started a = new project with Cordova OS X, and ported some code over. But it was not = working right. Took a long while to figure out what was happening. The = iOS version has support for passing ArrayBuffer objects from the JS to = native side (as NSData). This is a _very_ useful feature. So I had = assumed it would work with the OS X version. I was wrong of course. I tracked it down to this code in CDVBridge.m: - (NSArray WebScriptObject*)webScriptObject { // Assumption: webScriptObject has already been tested using = isArray: =20 NSUInteger count =3D [[webScriptObject valueForKey:@"length"] = integerValue]; NSMutableArray *a =3D [NSMutableArray array]; for (unsigned i =3D 0; i < count; i++) { id item =3D [webScriptObject webScriptValueAtIndex:i]; if ([item isKindOfClass:[WebScriptObject class]]) { if ([self isArray:item]) { [a addObject:[self = convertWebScriptObjectToNSArray:item]]; } else if ([self isDictionary:item]) { [a addObject:[self = convertWebScriptObjectToNSDictionary:item]]; }; } else { [a addObject:item]; } } =20 return a; } The ArrayBuffer object isKindOfClass WebScriptObject, but it is neither = an Array or a Dictionary, so it gets dropped here. Any chance on a patch to make this work? I am a programmer, but not = familiar enough with the Cordova internals and/or the WebScript area to = know the proper check and conversion to put here. Thank you, Tyler=