OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 } | 1107 } |
1108 #endif | 1108 #endif |
1109 | 1109 |
1110 // Inconsistent use of module. Throw a syntax error. | 1110 // Inconsistent use of module. Throw a syntax error. |
1111 // TODO(rossberg): generate more helpful error message. | 1111 // TODO(rossberg): generate more helpful error message. |
1112 MessageLocation location( | 1112 MessageLocation location( |
1113 info->script(), proxy->position(), proxy->position()); | 1113 info->script(), proxy->position(), proxy->position()); |
1114 Isolate* isolate = info->isolate(); | 1114 Isolate* isolate = info->isolate(); |
1115 Factory* factory = isolate->factory(); | 1115 Factory* factory = isolate->factory(); |
1116 Handle<JSArray> array = factory->NewJSArray(1); | 1116 Handle<JSArray> array = factory->NewJSArray(1); |
1117 USE(JSObject::SetElement(array, 0, var->name(), NONE, STRICT)); | 1117 JSObject::SetElement(array, 0, var->name(), NONE, STRICT).Assert(); |
1118 Handle<Object> result = | 1118 Handle<Object> result = |
1119 factory->NewSyntaxError("module_type_error", array); | 1119 factory->NewSyntaxError("module_type_error", array); |
1120 isolate->Throw(*result, &location); | 1120 isolate->Throw(*result, &location); |
1121 return false; | 1121 return false; |
1122 } | 1122 } |
1123 } | 1123 } |
1124 | 1124 |
1125 proxy->BindTo(var); | 1125 proxy->BindTo(var); |
1126 | 1126 |
1127 return true; | 1127 return true; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 } | 1395 } |
1396 | 1396 |
1397 | 1397 |
1398 int Scope::ContextLocalCount() const { | 1398 int Scope::ContextLocalCount() const { |
1399 if (num_heap_slots() == 0) return 0; | 1399 if (num_heap_slots() == 0) return 0; |
1400 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1400 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1401 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1401 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
1402 } | 1402 } |
1403 | 1403 |
1404 } } // namespace v8::internal | 1404 } } // namespace v8::internal |
OLD | NEW |