зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1127827, part 3 - Weak map get should always return undefined on failure to find the key. r=Waldo,jgraham
This commit is contained in:
Родитель
d4268b8f27
Коммит
72065b93ca
|
@ -2,7 +2,6 @@
|
|||
"WeakMap.prototype.clear.length": true,
|
||||
"WeakMap.prototype.delete.length": true,
|
||||
"WeakMap.prototype.get.length": true,
|
||||
"WeakMap.prototype.get: return undefined": true,
|
||||
"WeakMap.prototype.has.length": true,
|
||||
"WeakMap.prototype.set.length": true
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ WeakMap_get_impl(JSContext *cx, CallArgs args)
|
|||
}
|
||||
}
|
||||
|
||||
args.rval().set((args.length() > 1) ? args[1] : UndefinedValue());
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ function test()
|
|||
check(function() map.set(key, 42) === map);
|
||||
check(function() map.get(key) == 42);
|
||||
check(function() typeof map.get({}) == "undefined");
|
||||
check(function() map.get({}, "foo") == "foo");
|
||||
check(function() map.get({}, "foo") == undefined);
|
||||
|
||||
gc(); gc(); gc();
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
[WeakMap.prototype-properties.html]
|
||||
type: testharness
|
||||
|
||||
[WeakMap.prototype.get.length]
|
||||
expected: FAIL
|
||||
|
||||
[WeakMap.prototype.get: return undefined]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче