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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 FunctionTemplate::New(RealmDispose)); | 1452 FunctionTemplate::New(RealmDispose)); |
1453 realm_template->Set(String::New("switch"), | 1453 realm_template->Set(String::New("switch"), |
1454 FunctionTemplate::New(RealmSwitch)); | 1454 FunctionTemplate::New(RealmSwitch)); |
1455 realm_template->Set(String::New("eval"), | 1455 realm_template->Set(String::New("eval"), |
1456 FunctionTemplate::New(RealmEval)); | 1456 FunctionTemplate::New(RealmEval)); |
1457 realm_template->SetAccessor(String::New("shared"), | 1457 realm_template->SetAccessor(String::New("shared"), |
1458 RealmSharedGet, RealmSharedSet); | 1458 RealmSharedGet, RealmSharedSet); |
1459 global_template->Set(String::New("Realm"), realm_template); | 1459 global_template->Set(String::New("Realm"), realm_template); |
1460 | 1460 |
1461 // Bind the handlers for external arrays. | 1461 // Bind the handlers for external arrays. |
1462 PropertyAttribute attr = | 1462 if (!i::FLAG_harmony_typed_arrays) { |
1463 static_cast<PropertyAttribute>(ReadOnly | DontDelete); | 1463 PropertyAttribute attr = |
1464 global_template->Set(PerIsolateData::ArrayBuffer_string(isolate), | 1464 static_cast<PropertyAttribute>(ReadOnly | DontDelete); |
1465 CreateArrayBufferTemplate(ArrayBuffer), attr); | 1465 global_template->Set(PerIsolateData::ArrayBuffer_string(isolate), |
1466 global_template->Set(String::New("Int8Array"), | 1466 CreateArrayBufferTemplate(ArrayBuffer), attr); |
1467 CreateArrayTemplate(Int8Array), attr); | 1467 global_template->Set(String::New("Int8Array"), |
1468 global_template->Set(String::New("Uint8Array"), | 1468 CreateArrayTemplate(Int8Array), attr); |
1469 CreateArrayTemplate(Uint8Array), attr); | 1469 global_template->Set(String::New("Uint8Array"), |
1470 global_template->Set(String::New("Int16Array"), | 1470 CreateArrayTemplate(Uint8Array), attr); |
1471 CreateArrayTemplate(Int16Array), attr); | 1471 global_template->Set(String::New("Int16Array"), |
1472 global_template->Set(String::New("Uint16Array"), | 1472 CreateArrayTemplate(Int16Array), attr); |
1473 CreateArrayTemplate(Uint16Array), attr); | 1473 global_template->Set(String::New("Uint16Array"), |
1474 global_template->Set(String::New("Int32Array"), | 1474 CreateArrayTemplate(Uint16Array), attr); |
1475 CreateArrayTemplate(Int32Array), attr); | 1475 global_template->Set(String::New("Int32Array"), |
1476 global_template->Set(String::New("Uint32Array"), | 1476 CreateArrayTemplate(Int32Array), attr); |
1477 CreateArrayTemplate(Uint32Array), attr); | 1477 global_template->Set(String::New("Uint32Array"), |
1478 global_template->Set(String::New("Float32Array"), | 1478 CreateArrayTemplate(Uint32Array), attr); |
1479 CreateArrayTemplate(Float32Array), attr); | 1479 global_template->Set(String::New("Float32Array"), |
1480 global_template->Set(String::New("Float64Array"), | 1480 CreateArrayTemplate(Float32Array), attr); |
1481 CreateArrayTemplate(Float64Array), attr); | 1481 global_template->Set(String::New("Float64Array"), |
1482 global_template->Set(String::New("Uint8ClampedArray"), | 1482 CreateArrayTemplate(Float64Array), attr); |
1483 CreateArrayTemplate(Uint8ClampedArray), attr); | 1483 global_template->Set(String::New("Uint8ClampedArray"), |
| 1484 CreateArrayTemplate(Uint8ClampedArray), attr); |
| 1485 } |
1484 | 1486 |
1485 #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64) | 1487 #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64) |
1486 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); | 1488 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); |
1487 AddOSMethods(os_templ); | 1489 AddOSMethods(os_templ); |
1488 global_template->Set(String::New("os"), os_templ); | 1490 global_template->Set(String::New("os"), os_templ); |
1489 #endif // V8_SHARED | 1491 #endif // V8_SHARED |
1490 | 1492 |
1491 return global_template; | 1493 return global_template; |
1492 } | 1494 } |
1493 | 1495 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 } | 2219 } |
2218 | 2220 |
2219 } // namespace v8 | 2221 } // namespace v8 |
2220 | 2222 |
2221 | 2223 |
2222 #ifndef GOOGLE3 | 2224 #ifndef GOOGLE3 |
2223 int main(int argc, char* argv[]) { | 2225 int main(int argc, char* argv[]) { |
2224 return v8::Shell::Main(argc, argv); | 2226 return v8::Shell::Main(argc, argv); |
2225 } | 2227 } |
2226 #endif | 2228 #endif |
OLD | NEW |