-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue in setting accessor in PathTypeHandlerWithAttr
When the property is deleted (say when we are in SimpleTypeHandler) and then later if we create an accessor on the same property we have converted the type handler to PathTypeHandlerWithAttr. But during setting the accessor on that slot we haven't removed the is_deleted attribute. So when we try to get the property - we don't get that from the PathTypeHandlerWithAttr handler. Fixed that by removing that attribute when we do SetAccessor.
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
function testReconfigureAsAccessorProperty(f) { | ||
var length = 2; | ||
Object.defineProperty(f, 'length', { | ||
get: function () { | ||
return length; | ||
}, | ||
set: function (v) { | ||
length = v; | ||
} | ||
}); | ||
} | ||
(function testSetOnInstance() { | ||
function f() {} | ||
delete f.length; | ||
testReconfigureAsAccessorProperty(f); | ||
Object.defineProperty(Function.prototype, 'length', { | ||
writable: true | ||
}); | ||
f.length = 123; | ||
f.length == 123 ? print("Pass") : print('fail'); | ||
})(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters