Bug 1064935 - Alias ctypes.jschar to ctypes.char16_t. r=cpeterson
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 09 Sep 2014 09:46:00 -0400
changeset 204428 94342d2b81e623dd1a6e0af3e3ec114b20dd506a
parent 204427 5d1141600ed400ade0a1b90d9e779e6275f88372
child 204429 c2b0c3d348d474582f96d8417d4978a229c33ff8
push id27456
push userryanvm@gmail.com
push dateTue, 09 Sep 2014 23:26:49 +0000
treeherdermozilla-central@152ef25e89ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs1064935
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1064935 - Alias ctypes.jschar to ctypes.char16_t. r=cpeterson
js/src/ctypes/CTypes.cpp
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1291,16 +1291,22 @@ InitTypeClasses(JSContext* cx, HandleObj
 #include "ctypes/typedefs.h"
 
   // Alias 'ctypes.unsigned' as 'ctypes.unsigned_int', since they represent
   // the same type in C.
   if (!JS_DefineProperty(cx, parent, "unsigned", typeObj_unsigned_int,
                          JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
     return false;
 
+  // Alias 'ctypes.jschar' as 'ctypes.char16_t' to prevent breaking addons
+  // that are still using jschar (bug 1064935).
+  if (!JS_DefineProperty(cx, parent, "jschar", typeObj_char16_t,
+                         JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
+    return false;
+
   // Create objects representing the special types void_t and voidptr_t.
   RootedObject typeObj(cx,
     CType::DefineBuiltin(cx, parent, "void_t", CTypeProto, CDataProto, "void",
                          TYPE_void_t, JSVAL_VOID, JSVAL_VOID, &ffi_type_void));
   if (!typeObj)
     return false;
 
   typeObj = PointerType::CreateInternal(cx, typeObj);