@@ -187,21 +187,20 @@ namespace Js
187
187
return FALSE ;
188
188
}
189
189
190
- bool JavascriptStackWalker::GetThis (Var* pVarThis, int moduleId) const
190
+ void JavascriptStackWalker::GetThis (Var* pVarThis, int moduleId) const
191
191
{
192
192
#if ENABLE_NATIVE_CODEGEN
193
193
if (inlinedFramesBeingWalked)
194
194
{
195
195
if (inlinedFrameWalker.GetArgc () == 0 )
196
196
{
197
197
*pVarThis = JavascriptOperators::OP_GetThis (this ->scriptContext ->GetLibrary ()->GetUndefined (), moduleId, scriptContext);
198
- return false ;
199
198
}
200
-
201
- *pVarThis = inlinedFrameWalker. GetThisObject ();
202
- Assert ( *pVarThis);
203
-
204
- return true ;
199
+ else
200
+ {
201
+ *pVarThis = inlinedFrameWalker. GetThisObject ( );
202
+ Assert (*pVarThis);
203
+ }
205
204
}
206
205
else
207
206
#endif
@@ -210,11 +209,16 @@ namespace Js
210
209
if (callInfo.Count == 0 )
211
210
{
212
211
*pVarThis = JavascriptOperators::OP_GetThis (scriptContext->GetLibrary ()->GetUndefined (), moduleId, scriptContext);
213
- return false ;
214
212
}
213
+ else
214
+ {
215
+ *pVarThis = this ->GetThisFromFrame ();
216
+ }
217
+ }
215
218
216
- *pVarThis = this ->GetThisFromFrame ();
217
- return (*pVarThis) != nullptr ;
219
+ if (*pVarThis == nullptr )
220
+ {
221
+ *pVarThis = this ->scriptContext ->GetLibrary ()->GetNull ();
218
222
}
219
223
}
220
224
@@ -1188,14 +1192,17 @@ namespace Js
1188
1192
return FALSE ;
1189
1193
}
1190
1194
1191
- bool JavascriptStackWalker::GetThis (Var* pThis, int moduleId, ScriptContext* scriptContext)
1195
+ void JavascriptStackWalker::GetThis (Var* pThis, int moduleId, ScriptContext* scriptContext)
1192
1196
{
1193
1197
JavascriptStackWalker walker (scriptContext);
1194
1198
JavascriptFunction* caller;
1195
- return walker.GetCaller (&caller) && walker.GetThis (pThis, moduleId);
1199
+ if (walker.GetCaller (&caller))
1200
+ {
1201
+ walker.GetThis (pThis, moduleId);
1202
+ }
1196
1203
}
1197
1204
1198
- bool JavascriptStackWalker::GetThis (Var* pThis, int moduleId, JavascriptFunction* func, ScriptContext* scriptContext)
1205
+ void JavascriptStackWalker::GetThis (Var* pThis, int moduleId, JavascriptFunction* func, ScriptContext* scriptContext)
1199
1206
{
1200
1207
JavascriptStackWalker walker (scriptContext);
1201
1208
JavascriptFunction* caller;
@@ -1204,10 +1211,9 @@ namespace Js
1204
1211
if (caller == func)
1205
1212
{
1206
1213
walker.GetThis (pThis, moduleId);
1207
- return true ;
1214
+ return ;
1208
1215
}
1209
1216
}
1210
- return false ;
1211
1217
}
1212
1218
1213
1219
// Try to see whether there is a top-most javascript frame, and if there is return true if it's native.
0 commit comments