Bug 1279633 - Define AsmJSCache_MIN in terms of AsmJSCacheSuccess, instead of the other way around; r=till
authorNick Fitzgerald <fitzgen@gmail.com>
Sun, 12 Jun 2016 08:04:48 -0700
changeset 377812 d1722ce2542a2dcc6d351da7481640aceb44f894
parent 377811 4073f541e59556b7f9a8e0d7078165dd74050863
child 377813 db19efc535507bad78a3e6e1a22a745aac1e8eca
child 377825 d6bcb30d2ad0735a2d63ec16c17d6ab91b32fc69
child 377838 c7ddd550008cd59ccb7629247d9296b95cdb9925
push id20857
push userbmo:james@hoppipolla.co.uk
push dateSun, 12 Jun 2016 16:59:39 +0000
reviewerstill
bugs1279633
milestone50.0a1
Bug 1279633 - Define AsmJSCache_MIN in terms of AsmJSCacheSuccess, instead of the other way around; r=till rust-bindgen will make an enum variant for the first definition it encounters, and then define duplicates as constants outside of the enum definition. This has the unfortunate effect of making AsmJSCache_MIN an enum variant and AsmJSCache_Success the constant definition outside of the enum in the case of the AsmJSCacheResult enumeration. This commit rectifies that. This upstreams the following commit from servo/mozjs: 50f47cf Bind AsmJSCache_Success rather than AsmJSCache_MIN
js/src/jsapi.h
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -5705,18 +5705,18 @@ typedef bool
 (* OpenAsmJSCacheEntryForReadOp)(HandleObject global, const char16_t* begin, const char16_t* limit,
                                  size_t* size, const uint8_t** memory, intptr_t* handle);
 typedef void
 (* CloseAsmJSCacheEntryForReadOp)(size_t size, const uint8_t* memory, intptr_t handle);
 
 /** The list of reasons why an asm.js module may not be stored in the cache. */
 enum AsmJSCacheResult
 {
-    AsmJSCache_MIN,
-    AsmJSCache_Success = AsmJSCache_MIN,
+    AsmJSCache_Success,
+    AsmJSCache_MIN = AsmJSCache_Success,
     AsmJSCache_ModuleTooSmall,
     AsmJSCache_SynchronousScript,
     AsmJSCache_QuotaExceeded,
     AsmJSCache_StorageInitFailure,
     AsmJSCache_Disabled_Internal,
     AsmJSCache_Disabled_ShellFlags,
     AsmJSCache_Disabled_JitInspector,
     AsmJSCache_InternalError,