-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Setting internal properties with "enumerable" attribute off. #3587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chakrabot
merged 2 commits into
chakra-core:release/1.7
from
rajatd:hasNoEnumerableProps-2
Aug 26, 2017
Merged
Setting internal properties with "enumerable" attribute off. #3587
chakrabot
merged 2 commits into
chakra-core:release/1.7
from
rajatd:hasNoEnumerableProps-2
Aug 26, 2017
Conversation
This file contains hidden or 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
curtisman
reviewed
Aug 25, 2017
| return TRUE; | ||
| } | ||
|
|
||
| DynamicTypeHandler * typeHandler = GetCurrentTypeHandler(instance); |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just call typeHandler->SetInternalProperty here?
Contributor
Author
|
Oh, that's right. Thanks!
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Curtis Man <[email protected]>
Sent: Thursday, August 24, 2017 8:11:30 PM
To: Microsoft/ChakraCore
Cc: Rajat Dua; Author
Subject: Re: [Microsoft/ChakraCore] Setting internal properties with "enumerable" attribute off. (#3587)
@curtisman commented on this pull request.
________________________________
In lib/Runtime/Types/DeferredTypeHandler.h<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FChakraCore%2Fpull%2F3587%23discussion_r135176560&data=02%7C01%7Cradua%40microsoft.com%7Cf9f709e0d5904f4b5bbb08d4eb66fbd2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636392274993415140&sdata=Obgatv3UoQDi%2B5XOoVQz1eaCHYqlLjhH3nRDL9AdjBI%3D&reserved=0>:
@@ -321,6 +322,20 @@ namespace Js
}
template <DeferredTypeInitializer initializer, typename DeferredTypeFilter, bool isPrototypeTemplate, uint16 _inlineSlotCapacity, uint16 _offsetOfInlineSlots>
+ BOOL DeferredTypeHandler<initializer, DeferredTypeFilter, isPrototypeTemplate, _inlineSlotCapacity, _offsetOfInlineSlots>::SetInternalProperty(DynamicObject* instance, PropertyId propertyId, Var value, PropertyOperationFlags flags)
+ {
+ if (!EnsureObjectReady(instance, DeferredInitializeMode_Set))
+ {
+ return TRUE;
+ }
+
+ DynamicTypeHandler * typeHandler = GetCurrentTypeHandler(instance);
+ return typeHandler->IsPathTypeHandler() ?
Just call typeHandler->SetInternalProperty here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FChakraCore%2Fpull%2F3587%23pullrequestreview-58560919&data=02%7C01%7Cradua%40microsoft.com%7Cf9f709e0d5904f4b5bbb08d4eb66fbd2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636392274993415140&sdata=ChxnXgwOMjhqhA%2FzL1IBbXLxWeM3kkxxjrEjbia4vNg%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOoxm4ecrx8jYhKyP8FMIbuAo-LWidNrks5sbjtigaJpZM4PCHEp&data=02%7C01%7Cradua%40microsoft.com%7Cf9f709e0d5904f4b5bbb08d4eb66fbd2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636392274993415140&sdata=C3lGmF7q6tQzseDOuwy0STLHBcLf2pTtqRPuT3Er2JI%3D&reserved=0>.
|
kunalspathak
approved these changes
Aug 25, 2017
…dler::SetInternalProperty
chakrabot
pushed a commit
that referenced
this pull request
Aug 26, 2017
…ttribute off. Merge pull request #3587 from rajatd:hasNoEnumerableProps-2 While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties. Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because, 1. An object with a path type handler should theoretically have hasNoEnumerableProperties set to false anyway. 2. Setting a non-enumerable property on an object with a path type handler will convert its type handler to a (simple) dictionary type handler. Fixes #1622
chakrabot
pushed a commit
that referenced
this pull request
Aug 26, 2017
…enumerable" attribute off. Merge pull request #3587 from rajatd:hasNoEnumerableProps-2 While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties. Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because, 1. An object with a path type handler should theoretically have hasNoEnumerableProperties set to false anyway. 2. Setting a non-enumerable property on an object with a path type handler will convert its type handler to a (simple) dictionary type handler. Fixes #1622
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties.
Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because,
Fixes #1622