js_hash_scope_add(JSContext *cx, JSScope *scope, jsval id, JSProperty *prop) { PRHashTable *table = scope->data; const void *key; PRHashNumber keyHash; PRHashEntry **hep; JSSymbol *sym, **sp; PR_ASSERT(JS_IS_LOCKED(cx)); table->allocPriv = cx; key = (const void *)id; keyHash = js_hash_id(key); hep = PR_HashTableRawLookup(table, keyHash, key); sym = (JSSymbol *) *hep; SCOPE_ADD( sym = (JSSymbol *) PR_HashTableRawAdd(table, hep, keyHash, key, NULL); if (!sym) return NULL; );
js_hash_scope_add(JSContext *cx, JSScope *scope, jsid id, JSScopeProperty *sprop) { PRHashTable *table = scope->data; const void *key; prhashcode keyHash; PRHashEntry **hep; JSSymbol *sym, **sp; JSScopePrivate *priv; PR_ASSERT(JS_IS_SCOPE_LOCKED(scope)); priv = table->allocPriv; priv->context = cx; key = (const void *)id; keyHash = js_hash_id(key); hep = PR_HashTableRawLookup(table, keyHash, key); sym = (JSSymbol *) *hep; SCOPE_ADD(priv, sym = (JSSymbol *) PR_HashTableRawAdd(table, hep, keyHash, key, NULL); if (!sym) return NULL; );