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
Родитель 427569d433
Коммит 615c9163b1
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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);

Просмотреть файл

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

Просмотреть файл

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