File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1212### Fixed
1313* Fix BMP issues. (#1497 )
1414* Update typings to support jpg and addPage on NodeCanvasRenderingContext2D (#1509 )
15+ * Fix assertion failure when using Visual Studio Code debugger to inspect Image prototype (#1534 )
1516
16172.6.1
1718==================
Original file line number Diff line number Diff line change @@ -187,6 +187,11 @@ NAN_SETTER(Image::SetHeight) {
187187 */
188188
189189NAN_METHOD (Image::GetSource){
190+ if (!Image::constructor.Get (info.GetIsolate ())->HasInstance (info.This ())) {
191+ // #1534
192+ Nan::ThrowTypeError (" Method Image.GetSource called on incompatible receiver" );
193+ return ;
194+ }
190195 Image *img = Nan::ObjectWrap::Unwrap<Image>(info.This ());
191196 info.GetReturnValue ().Set (Nan::New<String>(img->filename ? img->filename : " " ).ToLocalChecked ());
192197}
@@ -227,6 +232,11 @@ Image::clearData() {
227232 */
228233
229234NAN_METHOD (Image::SetSource){
235+ if (!Image::constructor.Get (info.GetIsolate ())->HasInstance (info.This ())) {
236+ // #1534
237+ Nan::ThrowTypeError (" Method Image.SetSource called on incompatible receiver" );
238+ return ;
239+ }
230240 Image *img = Nan::ObjectWrap::Unwrap<Image>(info.This ());
231241 cairo_status_t status = CAIRO_STATUS_READ_ERROR;
232242
You can’t perform that action at this time.
0 commit comments