compile_options == ScriptCompiler::kProduceCodeCache) {
info.PrepareForSerializing();
}
- if (FLAG_use_strict) {
- info.SetLanguageMode(
- static_cast<LanguageMode>(info.language_mode() | STRICT_BIT));
- }
+
+ LanguageMode language_mode =
+ construct_language_mode(FLAG_use_strict, FLAG_use_strong);
+ info.SetLanguageMode(
+ static_cast<LanguageMode>(info.language_mode() | language_mode));
result = CompileToplevel(&info);
if (extension == NULL && !result.is_null() && !result->dont_cache()) {
isolate->counters()->total_load_size()->Increment(source_length);
isolate->counters()->total_compile_size()->Increment(source_length);
- if (FLAG_use_strict) {
- info->SetLanguageMode(
- static_cast<LanguageMode>(info->language_mode() | STRICT_BIT));
- }
+ LanguageMode language_mode =
+ construct_language_mode(FLAG_use_strict, FLAG_use_strong);
+ info->SetLanguageMode(
+ static_cast<LanguageMode>(info->language_mode() | language_mode));
+
// TODO(marja): FLAG_serialize_toplevel is not honoured and won't be; when the
// real code caching lands, streaming needs to be adapted to use it.
return CompileToplevel(info);
// Flags for language modes and experimental language features.
DEFINE_BOOL(use_strict, false, "enforce strict mode")
+DEFINE_BOOL(use_strong, false, "enforce strong mode")
+DEFINE_IMPLICATION(use_strong, use_strict)
+
+DEFINE_BOOL(strong_mode, false, "experimental strong language mode")
+DEFINE_IMPLICATION(use_strong, strong_mode)
DEFINE_BOOL(es_staging, false, "enable all completed harmony features")
DEFINE_BOOL(harmony, false, "enable all completed harmony features")
DEFINE_BOOL(vector_ics, false, "support vector-based ics")
DEFINE_BOOL(experimental_classes, false,
"experimental new semantics for super() calls")
-DEFINE_BOOL(strong_mode, false, "experimental strong language mode")
DEFINE_IMPLICATION(experimental_classes, harmony_classes)
DEFINE_IMPLICATION(experimental_classes, harmony_object_literals)
Handle<Context> context) {
Isolate* isolate = GetIsolate();
Handle<SharedFunctionInfo> shared(context->closure()->shared());
- StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY,
- RelocInfo::kNoPosition);
+ LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong);
+ StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition);
int entry = FindEntry(&key);
if (entry == kNotFound) return isolate->factory()->undefined_value();
int index = EntryToIndex(entry);
Handle<Context> context, Handle<Object> value) {
Isolate* isolate = cache->GetIsolate();
Handle<SharedFunctionInfo> shared(context->closure()->shared());
- StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY,
- RelocInfo::kNoPosition);
+ LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong);
+ StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition);
{
Handle<Object> k = key.AsHandle(isolate);
DisallowHeapAllocation no_allocation_scope;