@@ -286,6 +286,7 @@ void msV8FreeContext(mapObj *map)
286
286
* style. */
287
287
char * msV8GetFeatureStyle (mapObj *map, const char *filename, layerObj *layer, shapeObj *shape)
288
288
{
289
+ TryCatch try_catch;
289
290
V8Context* v8context = V8CONTEXT (map);
290
291
char *ret = NULL ;
291
292
@@ -317,6 +318,10 @@ char* msV8GetFeatureStyle(mapObj *map, const char *filename, layerObj *layer, sh
317
318
}
318
319
Handle <Function> func = Handle <Function>::Cast (value);
319
320
Handle <Value> result = func->Call (global, 0 , 0 );
321
+ if (result.IsEmpty () && try_catch.HasCaught ()) {
322
+ msV8ReportException (&try_catch);
323
+ }
324
+
320
325
if (!result.IsEmpty () && !result->IsUndefined ()) {
321
326
String::AsciiValue ascii (result);
322
327
ret = msStrdup (*ascii);
@@ -328,6 +333,7 @@ char* msV8GetFeatureStyle(mapObj *map, const char *filename, layerObj *layer, sh
328
333
/* for geomtransform, we don't have the mapObj */
329
334
shapeObj *msV8TransformShape (shapeObj *shape, const char * filename)
330
335
{
336
+ TryCatch try_catch;
331
337
Isolate *isolate = Isolate::GetCurrent ();
332
338
V8Context *v8context = (V8Context*)isolate->GetData ();
333
339
@@ -353,6 +359,10 @@ shapeObj *msV8TransformShape(shapeObj *shape, const char* filename)
353
359
}
354
360
Handle <Function> func = Handle <Function>::Cast (value);
355
361
Handle <Value> result = func->Call (global, 0 , 0 );
362
+ if (result.IsEmpty () && try_catch.HasCaught ()) {
363
+ msV8ReportException (&try_catch);
364
+ }
365
+
356
366
if (!result.IsEmpty () && result->IsObject ()) {
357
367
Handle <Object> obj = result->ToObject ();
358
368
if (obj->GetConstructorName ()->Equals (String::New (" shapeObj" ))) {
0 commit comments