Bug 554955: Make JSObject::setMap not pretend to take a const shape. r=jorendorff

This commit is contained in:
Jim Blandy 2011-03-15 12:18:36 -07:00
parent 427569d433
commit 615c9163b1
3 changed files with 5 additions and 5 deletions

View File

@ -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<JSObjectMap *>(amap);
map = amap;
objShape = map->shape;
}
void setSharedNonNativeMap() {
setMap(&JSObjectMap::sharedNonNative);
setMap(const_cast<JSObjectMap *>(&JSObjectMap::sharedNonNative));
}
void deletingShapeChange(JSContext *cx, const js::Shape &shape);

View File

@ -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 {
/*

View File

@ -85,7 +85,7 @@ Bindings::clone(JSContext *cx, Bindings *bindings)
*this = *bindings;
}
const Shape *
Shape *
Bindings::lastShape() const
{
JS_ASSERT(lastBinding);