-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
HTML search: check for query terms presence in index term properties #13097
base: master
Are you sure you want to change the base?
Changes from all commits
47f6547
713d6bb
0fff170
64d6e09
9bab17c
9b1edac
52b9de3
bcb02fe
7267990
462c859
443fd21
295d230
3498755
f38ce20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ECMAScript | ||
---------- | ||
|
||
This is a sample JavaScript (aka ``ECMAScript``) project used to generate a search engine index fixture. | ||
|
||
Use the `__proto__` property to access the `prototype <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes>`_ (if any) of an object instance. |
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.
I think @wlach is right that immutability is orthoganal here. I think 'simply' using
JSON.parse
rather than an object literal would solve the__proto__
case. Would we then need to keep thehasOwnProperty
checks?An alternative would be to use a reviver function that constructs
Map
objects/serialise the index withMap
literals, and use.get()
, but that may also be expensive.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.
Ok, yep - I can revert 443fd21 to remove the use of
Object.freeze
/ the reviver function.We should keep those, I think. Without them, queries for
__proto__
may continue to inadvertently retrieve object prototypes instead of getting anundefined
result.What do you think about constructing those
Map
objects directly in thesearchindex.js
file format, instead of usingJSON.parse
and a reviver?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.
IMO this is definitely worth a shot, I suspect it'll be quite fast.