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:
Andrew McCreight 2015-02-18 15:40:52 -08:00
parent 250ca51bbc
commit fd32bda0ad
4 changed files with 3 additions and 6 deletions

View File

@ -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
}

View File

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

View File

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

View File

@ -1,8 +1,6 @@
[WeakMap.prototype-properties.html]
type: testharness
[WeakMap.prototype.get.length]
expected: FAIL
[WeakMap.prototype.get: return undefined]
expected: FAIL