Repository navigation
[Release] Increase version to 1.1.5 (and #47) #48
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
|---|---|---|
|
|
@@ -60,6 +60,11 @@ const DynAllowInstChkTag = DynInstChkTag; | |
| */ | ||
| const DynProtoDefaultOptions = '_dfOpts'; | ||
|
|
||
| /** | ||
| * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist | ||
| */ | ||
| const DynProtoPolyProto = "_dynProto"; | ||
|
|
||
| /** | ||
| * Value used as the name of a class when it cannot be determined | ||
| * @ignore | ||
|
|
@@ -135,8 +140,13 @@ function _getObjProto(target:any) { | |
| } | ||
|
|
||
| // target[Constructor] May break if the constructor has been changed or removed | ||
| let newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); | ||
| let newProto = target[DynProtoPolyProto] || target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); | ||
| if(newProto) { | ||
| // Set the _dynProto so the hierarchy can lookup base classes correctly on IE8 | ||
| if (!target[DynProtoPolyProto]) { | ||
| target[DynProtoPolyProto] = newProto; | ||
| } | ||
|
|
||
| return newProto; | ||
| } | ||
| } | ||
|
|
@@ -431,9 +441,12 @@ function _checkPrototype(classProto:any, thisTarget:any) { | |
| visited.push(thisProto); | ||
| thisProto = _getObjProto(thisProto); | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| return false; | ||
| // If objGetPrototypeOf doesn't exist then just assume everything is ok. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only affects "Old" runtimes IE8 and eariler. |
||
| return true; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "name": "@microsoft/dynamicproto-js", | ||
| "description": "Microsoft Dynamic Proto Utility", | ||
| "version": "1.1.4", | ||
| "version": "1.1.5", | ||
| "keywords": [ | ||
| "javascript", | ||
| "dynamic prototype", | ||
|
|
@@ -40,6 +40,7 @@ | |
| "homepage": "https://github.com/microsoft/DynamicProto-JS#readme", | ||
| "dependencies": {}, | ||
| "devDependencies": { | ||
| "@microsoft/rush": "^5.67.0", | ||
| "@nevware21/grunt-ts-plugin": "^0.3.0", | ||
| "@nevware21/grunt-eslint-ts": "^0.1.0", | ||
| "@typescript-eslint/eslint-plugin": "^4.28.0", | ||
|
|
@@ -50,8 +51,8 @@ | |
| "eslint-plugin-node": "^11.1.0", | ||
| "eslint-plugin-promise": "^5.1.0", | ||
| "eslint-plugin-security": "^1.4.0", | ||
| "grunt": "^1.4.1", | ||
| "grunt-cli": "^1.3.2", | ||
| "grunt": "^1.5.2", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Component Governance fixes |
||
| "grunt-cli": "^1.4.3", | ||
| "grunt-contrib-qunit": "^4.0.0", | ||
| "grunt-contrib-uglify": "^5.0.1", | ||
| "grunt-run": "^0.8.1", | ||
|
|
||
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.
Because IE8 doesn't support looking up the prototype of a prototype, we need to provide hints to allow base classes that are also defined using dynamicProto() to be looked up.
This issue only exists for nested classes of 2 or more. And this part of the code only runs on older browsers