-
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. Since a property got deleted and PathTypeHandler should not handle that deleted property we need to convert this to Dictionary type. In order to fix that When we add the accessor on any property we need to check if any property deleted upon that we need to convert to Dictionary type instead of type.
- Loading branch information
Showing
5 changed files
with
54 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
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