Index: src/accessors.cc |
diff --git a/src/accessors.cc b/src/accessors.cc |
index 4da9dd44ffeca52f50bb983f596dd99ee8136f5d..8cc791080742f80b876105aea984fe7f6f3cb879 100644 |
--- a/src/accessors.cc |
+++ b/src/accessors.cc |
@@ -28,6 +28,7 @@ |
#include "v8.h" |
#include "accessors.h" |
+#include "compiler.h" |
#include "contexts.h" |
#include "deoptimizer.h" |
#include "execution.h" |
@@ -648,11 +649,11 @@ MaybeObject* Accessors::FunctionGetLength(Isolate* isolate, |
// If the function isn't compiled yet, the length is not computed correctly |
// yet. Compile it now and return the right length. |
HandleScope scope(isolate); |
- Handle<JSFunction> handle(function); |
- if (JSFunction::CompileLazy(handle, KEEP_EXCEPTION)) { |
- return Smi::FromInt(handle->shared()->length()); |
+ Handle<JSFunction> function_handle(function); |
+ if (!Compiler::EnsureCompiled(function_handle, KEEP_EXCEPTION)) { |
titzer
2013/12/09 14:49:28
Not sure why you negated this condition, can you s
Yang
2013/12/10 11:22:04
Done.
|
+ return Failure::Exception(); |
} |
- return Failure::Exception(); |
+ return Smi::FromInt(function_handle->shared()->length()); |
} |