зеркало из https://github.com/mozilla/gecko-dev.git
Bug 554955: Make JSObject::setMap not pretend to take a const shape. r=jorendorff
This commit is contained in:
Родитель
427569d433
Коммит
615c9163b1
|
@ -505,14 +505,14 @@ struct JSObject : js::gc::Cell {
|
||||||
|
|
||||||
bool hasOwnShape() const { return !!(flags & OWN_SHAPE); }
|
bool hasOwnShape() const { return !!(flags & OWN_SHAPE); }
|
||||||
|
|
||||||
void setMap(const JSObjectMap *amap) {
|
void setMap(JSObjectMap *amap) {
|
||||||
JS_ASSERT(!hasOwnShape());
|
JS_ASSERT(!hasOwnShape());
|
||||||
map = const_cast<JSObjectMap *>(amap);
|
map = amap;
|
||||||
objShape = map->shape;
|
objShape = map->shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSharedNonNativeMap() {
|
void setSharedNonNativeMap() {
|
||||||
setMap(&JSObjectMap::sharedNonNative);
|
setMap(const_cast<JSObjectMap *>(&JSObjectMap::sharedNonNative));
|
||||||
}
|
}
|
||||||
|
|
||||||
void deletingShapeChange(JSContext *cx, const js::Shape &shape);
|
void deletingShapeChange(JSContext *cx, const js::Shape &shape);
|
||||||
|
|
|
@ -203,7 +203,7 @@ class Bindings {
|
||||||
bool hasLocalNames() const { return countLocalNames() > 0; }
|
bool hasLocalNames() const { return countLocalNames() > 0; }
|
||||||
|
|
||||||
/* Returns the shape lineage generated for these bindings. */
|
/* Returns the shape lineage generated for these bindings. */
|
||||||
inline const js::Shape *lastShape() const;
|
inline js::Shape *lastShape() const;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -85,7 +85,7 @@ Bindings::clone(JSContext *cx, Bindings *bindings)
|
||||||
*this = *bindings;
|
*this = *bindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Shape *
|
Shape *
|
||||||
Bindings::lastShape() const
|
Bindings::lastShape() const
|
||||||
{
|
{
|
||||||
JS_ASSERT(lastBinding);
|
JS_ASSERT(lastBinding);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче