From 615c9163b130b085bff5d457c6c0d5f7f4631540 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 15 Mar 2011 12:18:36 -0700 Subject: [PATCH] Bug 554955: Make JSObject::setMap not pretend to take a const shape. r=jorendorff --- js/src/jsobj.h | 6 +++--- js/src/jsscript.h | 2 +- js/src/jsscriptinlines.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 2282f0230b0c..a4a0dce72f8f 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -505,14 +505,14 @@ struct JSObject : js::gc::Cell { bool hasOwnShape() const { return !!(flags & OWN_SHAPE); } - void setMap(const JSObjectMap *amap) { + void setMap(JSObjectMap *amap) { JS_ASSERT(!hasOwnShape()); - map = const_cast(amap); + map = amap; objShape = map->shape; } void setSharedNonNativeMap() { - setMap(&JSObjectMap::sharedNonNative); + setMap(const_cast(&JSObjectMap::sharedNonNative)); } void deletingShapeChange(JSContext *cx, const js::Shape &shape); diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 010bb64b322d..1f9db651b5d9 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -203,7 +203,7 @@ class Bindings { bool hasLocalNames() const { return countLocalNames() > 0; } /* Returns the shape lineage generated for these bindings. */ - inline const js::Shape *lastShape() const; + inline js::Shape *lastShape() const; enum { /* diff --git a/js/src/jsscriptinlines.h b/js/src/jsscriptinlines.h index 5c8c02e449c3..1d48a75ead2d 100644 --- a/js/src/jsscriptinlines.h +++ b/js/src/jsscriptinlines.h @@ -85,7 +85,7 @@ Bindings::clone(JSContext *cx, Bindings *bindings) *this = *bindings; } -const Shape * +Shape * Bindings::lastShape() const { JS_ASSERT(lastBinding);