Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: src/api.cc

Issue 10914201: Fix edge case of extension with NULL as source string. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 int dep_count, 534 int dep_count,
535 const char** deps, 535 const char** deps,
536 int source_length) 536 int source_length)
537 : name_(name), 537 : name_(name),
538 source_length_(source_length >= 0 ? 538 source_length_(source_length >= 0 ?
539 source_length : 539 source_length :
540 (source ? static_cast<int>(strlen(source)) : 0)), 540 (source ? static_cast<int>(strlen(source)) : 0)),
541 source_(source, source_length_), 541 source_(source, source_length_),
542 dep_count_(dep_count), 542 dep_count_(dep_count),
543 deps_(deps), 543 deps_(deps),
544 auto_enable_(false) { } 544 auto_enable_(false) {
545 CHECK(source != NULL || source_length_ == 0);
546 }
545 547
546 548
547 v8::Handle<Primitive> Undefined() { 549 v8::Handle<Primitive> Undefined() {
548 i::Isolate* isolate = i::Isolate::Current(); 550 i::Isolate* isolate = i::Isolate::Current();
549 if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) { 551 if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
550 return v8::Handle<v8::Primitive>(); 552 return v8::Handle<v8::Primitive>();
551 } 553 }
552 return v8::Handle<Primitive>(ToApi<Primitive>( 554 return v8::Handle<Primitive>(ToApi<Primitive>(
553 isolate->factory()->undefined_value())); 555 isolate->factory()->undefined_value()));
554 } 556 }
(...skipping 5997 matching lines...) Expand 10 before | Expand all | Expand 10 after
6552 6554
6553 v->VisitPointers(blocks_.first(), first_block_limit_); 6555 v->VisitPointers(blocks_.first(), first_block_limit_);
6554 6556
6555 for (int i = 1; i < blocks_.length(); i++) { 6557 for (int i = 1; i < blocks_.length(); i++) {
6556 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 6558 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
6557 } 6559 }
6558 } 6560 }
6559 6561
6560 6562
6561 } } // namespace v8::internal 6563 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698